Reputation: 213
What are the best practices of getting item from clicked cell in GridView
?
Assume that GridView
items (cells) are filled using BaseAdapter
. And item contains of picture and text. How would you pass that unique clicked item to another activity?
Upvotes: 0
Views: 30
Reputation: 587
Set listener:
gridView.setOnItemClickListener(this);
and override this method:
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
... start your activity here ... (i stands for your clicked element)
}
Upvotes: 1