diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-06-22 03:11:46 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-06-22 03:11:46 +0200 |
commit | fe7d13c85f37d18b69b3ffcda28829a4e0ce9f14 (patch) | |
tree | d9d8c10f1c037b4b3366562fba348ba3535c5dba /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui | |
parent | 2786869e1b4cc81097cc7eb5b4d9e17ee5fc2269 (diff) | |
download | open-keychain-fe7d13c85f37d18b69b3ffcda28829a4e0ce9f14.tar.gz open-keychain-fe7d13c85f37d18b69b3ffcda28829a4e0ce9f14.tar.bz2 open-keychain-fe7d13c85f37d18b69b3ffcda28829a4e0ce9f14.zip |
add extra for initial fragment in MainActivity
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/MainActivity.java | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/MainActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/MainActivity.java index a0f6d0e1b..ec6fd1bbe 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/MainActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/MainActivity.java @@ -45,13 +45,15 @@ import org.sufficientlysecure.keychain.util.Preferences; public class MainActivity extends BaseNfcActivity implements FabContainer, OnBackStackChangedListener { - private static final int ID_KEYS = 1; - private static final int ID_ENCRYPT_DECRYPT = 2; - private static final int ID_APPS = 3; - private static final int ID_SETTINGS = 4; - private static final int ID_HELP = 5; + static final int ID_KEYS = 1; + static final int ID_ENCRYPT_DECRYPT = 2; + static final int ID_APPS = 3; + static final int ID_SETTINGS = 4; + 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_INIT_FRAG = "init_frag"; public Drawer.Result mDrawerResult; private Toolbar mToolbar; @@ -134,8 +136,20 @@ public class MainActivity extends BaseNfcActivity implements FabContainer, OnBac } if (savedInstanceState == null) { - // initialize FragmentLayout with KeyListFragment at first + // always initialize keys fragment to the bottom of the backstack 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; + } + } } } |