• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to resolve Back button issue in android device.

senthilmg

Lurker
Aug 26, 2010
4
0
friend's
I am facing a problem when i use back button in my android device or from UI, initially i have list view (List1) with content,when i click list view row it moves to next listview (List2) with AsyncTask to represent it progress upto it completion and to set on list(List2) ,and next i click this list(List2) i have to move webview,here my problem is back button is not working properly,it back to previos page but listview have empty display.
here my code for UI click event

back.setOnClickListener(new OnClickListener(){

finish();

});

how can i fix this problem
 
all the finish() call does is call the onStop() followed by onDestroy() for the current activity. Using this as the sole click event in your activity simply destroys the current view, revealing the previous view which, up until the click, has been stored in the activity stack. Your click event should call the onResume() of the previous activity (list2 if i read the example correctly) followed by the finish().

I hope this helps. PM if still stuck
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones