save picasso cache to a variable in java

  android, java, picasso

I am creating an application that generates random images at the touch of a button, but the cache is cleared at the touch of the makeover button and I would like someone to tell me how I could when changing the image save the previous cache and go back to the image previous

My code

nextButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String quest1 = "https://proxxcraft.com/naruto.php";
                Picasso.get().load(quest1).memoryPolicy(MemoryPolicy.NO_CACHE).into(memeRandomView);
                Picasso.get().isLoggingEnabled();
               
            }
        });

Source: Android Questions

LEAVE A COMMENT