Remove singleTop, as it's causing serious problems on the phone. And...
Fix fragment launching from another app - pass along the fragment class name and bundle from the original intent. Bug: 3064432 Bug: 3059311 (partial fix)
This commit is contained in:
@@ -16,9 +16,7 @@
|
||||
|
||||
package com.android.settings;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceActivity;
|
||||
|
||||
import java.util.List;
|
||||
@@ -30,6 +28,18 @@ public class Settings extends PreferenceActivity {
|
||||
|
||||
// TODO: Update Call Settings based on airplane mode state.
|
||||
|
||||
@Override
|
||||
public Intent getIntent() {
|
||||
String startingFragment = getStartingFragmentClass(super.getIntent());
|
||||
if (startingFragment != null && !onIsMultiPane()) {
|
||||
Intent modIntent = new Intent(super.getIntent());
|
||||
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, startingFragment);
|
||||
modIntent.putExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS, super.getIntent().getExtras());
|
||||
return modIntent;
|
||||
}
|
||||
return super.getIntent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the component name in the intent is different from the Settings class and
|
||||
* returns the class name to load as a fragment.
|
||||
@@ -51,6 +61,7 @@ public class Settings extends PreferenceActivity {
|
||||
if (fragmentClass != null) {
|
||||
Header header = new Header();
|
||||
header.fragment = fragmentClass;
|
||||
header.fragmentArguments = getIntent().getExtras();
|
||||
return header;
|
||||
}
|
||||
return super.onGetInitialHeader();
|
||||
|
Reference in New Issue
Block a user