Listview with Details

后端 未结 4 1893
予麋鹿
予麋鹿 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:51

    If I have understood, you want to send some information to another activity to display this information.

    You can have a look to the "Intent" in Android. It's used to start a component like an activity and can carry information to this new activity to start.

    Intent i = new Intent(ActivityA.this, ActivityB.class);
    i.putExtra("CUSTOMER_INFO", customer.getName());
    startActivity(i);
    

    Note: If you want to pass a custom object between activities, like for instance a List of custom object :

    List<'CustomObject'>
    

    Your custom object class have to implement Parcelable.

提交回复
热议问题