Android Gridview - Need to open different intents

后端 未结 1 626
南笙
南笙 2021-01-23 11:21

Just a beginner at Android development. I\'ve currently got a GridView setup to act as a main menu for my application. I\'ve managed to get an intent working using OnItemClickLi

相关标签:
1条回答
  • 2021-01-23 11:43

    You have

    public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
    

    so make use of the int position part of it...

    switch (position) {
    case 0:
    // start one activity
    break;
    case 1:
    // start another activity
    break;
    // etc.
    
    0 讨论(0)
提交回复
热议问题