Reputation: 1
I have a slide puzzle game.
I want to change image on GridView
by position(id).
How could I do that?
Upvotes: 0
Views: 143
Reputation: 1518
Try this
gridView.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3)
{
// You can get position of item or imageView and again you can set new image
// by setBackGround() by getting this position
}
});
Upvotes: 3