mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 19:22:14 -05:00
add extra for initial fragment in MainActivity
This commit is contained in:
parent
2786869e1b
commit
fe7d13c85f
@ -45,13 +45,15 @@ import org.sufficientlysecure.keychain.util.Preferences;
|
|||||||
|
|
||||||
public class MainActivity extends BaseNfcActivity implements FabContainer, OnBackStackChangedListener {
|
public class MainActivity extends BaseNfcActivity implements FabContainer, OnBackStackChangedListener {
|
||||||
|
|
||||||
private static final int ID_KEYS = 1;
|
static final int ID_KEYS = 1;
|
||||||
private static final int ID_ENCRYPT_DECRYPT = 2;
|
static final int ID_ENCRYPT_DECRYPT = 2;
|
||||||
private static final int ID_APPS = 3;
|
static final int ID_APPS = 3;
|
||||||
private static final int ID_SETTINGS = 4;
|
static final int ID_SETTINGS = 4;
|
||||||
private static final int ID_HELP = 5;
|
static final int ID_HELP = 5;
|
||||||
|
|
||||||
|
// both of these are used for instrumentation testing only
|
||||||
public static final String EXTRA_SKIP_FIRST_TIME = "skip_first_time";
|
public static final String EXTRA_SKIP_FIRST_TIME = "skip_first_time";
|
||||||
|
public static final String EXTRA_INIT_FRAG = "init_frag";
|
||||||
|
|
||||||
public Drawer.Result mDrawerResult;
|
public Drawer.Result mDrawerResult;
|
||||||
private Toolbar mToolbar;
|
private Toolbar mToolbar;
|
||||||
@ -134,8 +136,20 @@ public class MainActivity extends BaseNfcActivity implements FabContainer, OnBac
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (savedInstanceState == null) {
|
if (savedInstanceState == null) {
|
||||||
// initialize FragmentLayout with KeyListFragment at first
|
// always initialize keys fragment to the bottom of the backstack
|
||||||
onKeysSelected();
|
onKeysSelected();
|
||||||
|
|
||||||
|
if (data != null && data.hasExtra(EXTRA_INIT_FRAG)) {
|
||||||
|
// initialize FragmentLayout with KeyListFragment at first
|
||||||
|
switch (data.getIntExtra(EXTRA_INIT_FRAG, -1)) {
|
||||||
|
case ID_ENCRYPT_DECRYPT:
|
||||||
|
onEnDecryptSelected();
|
||||||
|
break;
|
||||||
|
case ID_APPS:
|
||||||
|
onAppsSelected();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user