From 26a9a9e42370f91cb179085a5ed567842f752753 Mon Sep 17 00:00:00 2001 From: Dominik Date: Wed, 25 Apr 2012 18:37:58 +0200 Subject: [PATCH] fixing layout when creating default rsa keys --- .../org/thialfihar/android/apg/ui/EditKeyActivity.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/org_apg/src/org/thialfihar/android/apg/ui/EditKeyActivity.java b/org_apg/src/org/thialfihar/android/apg/ui/EditKeyActivity.java index 822eb28d2..25a96c31e 100644 --- a/org_apg/src/org/thialfihar/android/apg/ui/EditKeyActivity.java +++ b/org_apg/src/org/thialfihar/android/apg/ui/EditKeyActivity.java @@ -84,6 +84,9 @@ public class EditKeyActivity extends SherlockFragmentActivity { // extends BaseA Vector mKeys; Vector mKeysUsages; + // will be set to true to build layout later in handler + private boolean mBuildLayout = true; + @Override public boolean onCreateOptionsMenu(Menu menu) { menu.add(1, Id.menu.option.cancel, 0, R.string.btn_doNotSave).setShowAsAction( @@ -175,6 +178,9 @@ public class EditKeyActivity extends SherlockFragmentActivity { // extends BaseA .getBoolean(Apg.EXTRA_GENERATE_DEFAULT_KEYS); if (generateDefaultKeys) { + // build layout in handler after generating keys not directly in onCreate + mBuildLayout = false; + // Send all information needed to service generate keys in other thread Intent intent = new Intent(this, ApgService.class); intent.putExtra(ApgService.EXTRA_ACTION, @@ -298,7 +304,9 @@ public class EditKeyActivity extends SherlockFragmentActivity { // extends BaseA } }); - buildLayout(); + if (mBuildLayout) { + buildLayout(); + } } /**