In my onCreate () method, I create an ImageButton View image:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_post);
final ImageButton ib = (ImageButton) findViewById(R.id.post_image);
...
In onResume, I want to be able to change ImageButton properties with something like: @Override protected void onResume () {super.onResume (); ib.setImageURI (selectedImageUri); } // END onResume
But onResume does not have access to the ib ImageButton object. If it were a variable, I would just make it a class variable, but Android does not allow you to define a View object in a class.
Any suggestions on how to do this?
Chris source
share