public YourActivity extends Activity {
...
private boolean extrasClearedOut;
...
public void onCreate(Bundle savedInstanceState) {
...
...
if (savedInstanceState != null &&
savedInstanceState.getBoolean("extras_cleared_out", false)) {
extrasClearedOut = true;
}
...
Intent intent = getIntent();
if (extrasClearedOut) {
// ignore the extras in the intent.
...
}
else {
// Read and use the extras in the intent.
}
}
protected void onNewIntent (Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
if (extrasClearedOut) {
// ignore the extras in the intent.
...
}
else {
// Read and use the extras in the intent.
}
}
...
...
public void someMethod(...) {
...
...
extrasClearedOut = true;
}
protected void onSaveInstanceState (Bundle outState) {
super.onSaveInstanceState(outState);
outState.putBoolean("extras_cleared_out", extrasClearedOut);
}
...
...
}
--
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