SettingsActivity: directly pass through bundle

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2017-11-27 05:22:54 +01:00 committed by Samuel Holland
parent 2cc7f6c2ea
commit 641e45e727

View File

@ -10,10 +10,8 @@ public class SettingsActivity extends Activity {
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final FragmentTransaction transaction = getFragmentManager().beginTransaction();
final Bundle args = new Bundle();
args.putBoolean("showQuickTile", getIntent().getBooleanExtra("showQuickTile", false));
final SettingsFragment fragment = new SettingsFragment();
fragment.setArguments(args);
fragment.setArguments(getIntent().getExtras());
transaction.replace(android.R.id.content, fragment).commit();
}
@ -22,7 +20,7 @@ public class SettingsActivity extends Activity {
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
if (getArguments().getBoolean("showQuickTile"))
if (getArguments() != null && getArguments().getBoolean("showQuickTile"))
((ConfigListPreference) findPreference("primary_config")).show();
}
}