Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi frnds,

I have two activity and each activity has listview data.when clicking any item from the listview of first activity sends to second activity, then clicking emulator back button then empty screen display instead of come back to the first activity. pls help me to solve this....
Posted

1 solution

When you move from first activity to second activity , you destroy the first activity.
You try the following code when click on list item to go to the second activity.

Java
listView.setOnItemClickListener(new OnItemClickListener() {

		@Override
		public void onItemClick(AdapterView					long arg3) {
				// TODO Auto-generated method stub
			Intent i = new Intent(this,SecondActivtiyName.class);
			startActivity(i);
			}
		});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900