Skip to content

Instantly share code, notes, and snippets.

@jaydp17
Last active August 29, 2015 14:14
Show Gist options
  • Save jaydp17/bdb96e4564e10c035155 to your computer and use it in GitHub Desktop.
Save jaydp17/bdb96e4564e10c035155 to your computer and use it in GitHub Desktop.
public class DummyActivity extends ActionBarActivity {
File f;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dummylayout);
// This image exists
f = new File(getFilesDir(), "abc.png");
final ImageView image = (ImageView) findViewById(R.id.imageView);
Button loadBtn = (Button) findViewById(R.id.load);
Button invalidateBtn = (Button) findViewById(R.id.invalidate);
Picasso.with(DummyActivity.this).load(f).into(image);
loadBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Picasso.with(DummyActivity.this).load(f).into(image);
}
});
invalidateBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Picasso.with(DummyActivity.this).invalidate(f);
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment