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.
ListView l = (ListView) findViewById(R.id.jl);
l.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
ClientListView j = JList.get(position);
String mess = "you clicked position " + position + " With Name " + j.GetClientName();
Toast.makeText(Home.this,mess,Toast.LENGTH_LONG).show();
}
}
);
}
i want to display information but not in toast, i will prefer some activity,fragment or some popup king of thing.
can anybody help?
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.
Note: If you want to pass a custom object between activities, like for instance a List of custom object :
Your custom object class have to implement Parcelable.
Use ths code:
Hope this will work..
If you want to pass Client Name which you are displaying in list, you can get id from adapter and use it.
You can get the intent value in another activity.