diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/SelectSignKeyIdActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/SelectSignKeyIdActivity.java index 5ec47f4c9..b3096ef99 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/SelectSignKeyIdActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/SelectSignKeyIdActivity.java @@ -42,9 +42,11 @@ public class SelectSignKeyIdActivity extends BaseActivity { private Uri mAppUri; private String mPreferredUserId; + private Intent mData; private SelectSignKeyIdListFragment mListFragment; private TextView mActionCreateKey; + private TextView mNone; @Override protected void onCreate(Bundle savedInstanceState) { @@ -67,18 +69,29 @@ public class SelectSignKeyIdActivity extends BaseActivity { createKey(mPreferredUserId); } }); + mNone = (TextView) findViewById(R.id.api_select_sign_key_none); + mNone.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + // 0 is "none" + mData.putExtra(OpenPgpApi.EXTRA_SIGN_KEY_ID, 0); + + setResult(Activity.RESULT_OK, mData); + finish(); + } + }); Intent intent = getIntent(); mAppUri = intent.getData(); mPreferredUserId = intent.getStringExtra(EXTRA_USER_ID); - Intent data = intent.getParcelableExtra(EXTRA_DATA); + mData = intent.getParcelableExtra(EXTRA_DATA); if (mAppUri == null) { Log.e(Constants.TAG, "Intent data missing. Should be Uri of app!"); finish(); return; } else { Log.d(Constants.TAG, "uri: " + mAppUri); - startListFragments(savedInstanceState, mAppUri, data); + startListFragments(savedInstanceState, mAppUri, mData); } } diff --git a/OpenKeychain/src/main/res/layout/api_select_sign_key_activity.xml b/OpenKeychain/src/main/res/layout/api_select_sign_key_activity.xml index 0528fc11e..981e01dd1 100644 --- a/OpenKeychain/src/main/res/layout/api_select_sign_key_activity.xml +++ b/OpenKeychain/src/main/res/layout/api_select_sign_key_activity.xml @@ -35,6 +35,28 @@ android:text="@string/api_select_sign_key_text" android:textAppearance="?android:attr/textAppearanceMedium" /> + + + + + +