开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜