Listview with Details

后端 未结 4 1851
予麋鹿
予麋鹿 2021-01-17 02:05

i have a Listview which displays list of clients, i have added an onClickListner to Listview so that i can get the detailed information of clicked client.

Li         


        
4条回答
  •  一向
    一向 (楼主)
    2021-01-17 02:49

    ListView l = (ListView) findViewById(R.id.jl);
    l.setOnItemClickListener(new OnItemClickListener() {
                             @Override
                             public void onItemClick(AdapterView parent, View view, int position, long id) {
                                 ClientListView j = JList.get(position);
                                 Intent intent = new Intent(this, SecondActivity.class);
                                 intent.putExtra("Keyname", j);
                                 startActivity(intent);
                             }
                         }
    );
    }
    

    You can get the intent value in another activity.

提交回复
热议问题