I have a GridView, using a custom adapter (myAdapter extends BaseAdapter), where each item in the grid holds an ImageButton. getView() is working fine.
However, from elsewhere in my code, how can I update the image (setImageResource) for one particular item in the grid based on its position in the GridView?
So far, I've added this to my adapter class:
public void changeImage() {
Log.d(TAG, "Image change");
this.ImageButton.setImageResource(R.drawable.newImage);
}
And would like to write something like this: mygridview.getItemIdAtPosition(20).changeImage();
(doesn't compile).