You have to store your application state before 'hiding' it - by
overriding onSaveInstanceState() method of your activity and putting
data that must be stored into Bundle passed to the method - and
restore the state when resuming (creating an instance again) - getting
stored info out of Bundle object passed to onCreate() method of the
activity.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// get out of bundle
String someData = savedInstanceState.getString("userName");
if (someData != null) {
// do something with it
EditText text = (EditText) findViewById(R.id.user_name);
text.setText(someData);
}
...
}
@Override
protected void onSaveInstanceState(Bundle outState) {
// get data from EditText view
EditText text = (EditText) findViewById(R.id.user_name);
// store data
outState.putString("userName", text);
}
Cheers,
Gawcio
On 26 Kwi, 17:13, Anu <[email protected]> wrote:
> I want to hide my app screen and then when the user clicks on the app
> again, I want to bring it to the foreground , but I want the app to
> maintain the screen that was pushed to background. Is there any way
> to
> do that right now?. Because when I try to hide my app, the surface
> of
> my app is gettng destroyed and so when I try to relaunch the app a
> new
> surface is created and my app status is changing.
>
> Regards,
> Anu G.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group
> athttp://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en