Android onResume Show Previous state of Activity

In my project I've several controls in my activity listView checkboxes and textboxes in several tabs now what i've seen when i press home key or recieve a call my activity put into pause and the control get reset (like listview will have to rebind & checkbox get unchecked) to prevent it i set saveEnabled = "true" but it does not work for listview Now i'll have to rebind my tabs again and fill the listview again

tell me is there any method which will save my current state and onResume will resume the previous one.

Answers


You should save your state in onPause() method and you can refresh your view in onResume()


There is no such API to save the state of the activity. You yourself have to save the state using SharedPreferences or some other method in onPause() and retrieve the state in onResume().


Need Your Help

Why can't we use C++ for web development?

c++ web-applications

Why can't we use C++ for web development?. I have been asking this question for a long time but i can't figure out the reason.

Show 1k instead of 1,000

php function numbers substr

function restyle_text($input){

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.