I have a ListView that shows a list of names. When you select a name, I want to pass the selected person' ID to the next view (Profile) and retreieve their data based on their ID.
I am able to load the Profile View, but do not know how to pass the ID from the ListView to the Profile. Here is how I am loading the Profile:
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,int position, long id) {
Intent myIntent = new Intent(view.getContext(), SubView.class); // when a row is tapped, load SubView.class
startActivityForResult(myIntent, 0); // display SubView.class
}
});