GridView get row and Column
Is that any way to get the row and column number of the clicked cell in GridView (Android)?
public void onItemClick(AdapterView parent,
开发者_运维技巧 View v, int position, long id)
{
int row_no=position/MAX_COL;
int col_no=position%MAX_COL;
Toast.makeText(getBaseContext(),
"pic" + (position + 1) + " selected" + "ID" + id,
Toast.LENGTH_SHORT).show();
}
I'm using this but is there any way to directly get the row, col no
精彩评论