return some more results

This commit is contained in:
Dominik Schürmann 2014-08-20 20:24:19 +02:00
parent 50c33ef322
commit 735040e193
2 changed files with 14 additions and 6 deletions

View File

@ -30,6 +30,7 @@ import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.ActionBarHelper; import org.sufficientlysecure.keychain.helper.ActionBarHelper;
import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.provider.ProviderHelper;
import org.sufficientlysecure.keychain.remote.AccountSettings; import org.sufficientlysecure.keychain.remote.AccountSettings;
import org.sufficientlysecure.keychain.service.OperationResultParcel;
import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.Log;
public class AccountSettingsActivity extends ActionBarActivity { public class AccountSettingsActivity extends ActionBarActivity {
@ -106,4 +107,15 @@ public class AccountSettingsActivity extends ActionBarActivity {
finish(); finish();
} }
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// if a result has been returned, display a notify
if (data != null && data.hasExtra(OperationResultParcel.EXTRA_RESULT)) {
OperationResultParcel result = data.getParcelableExtra(OperationResultParcel.EXTRA_RESULT);
result.createNotify(this).show();
} else {
super.onActivityResult(requestCode, resultCode, data);
}
}
} }

View File

@ -463,7 +463,8 @@ public class ImportKeysActivity extends ActionBarActivity {
return; return;
} }
if (ACTION_IMPORT_KEY_FROM_KEYSERVER_AND_RETURN_RESULT.equals(getIntent().getAction())) { if (ACTION_IMPORT_KEY_FROM_KEYSERVER_AND_RETURN_RESULT.equals(getIntent().getAction())
|| ACTION_IMPORT_KEY_FROM_FILE_AND_RETURN.equals(getIntent().getAction())) {
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra(ImportKeyResult.EXTRA_RESULT, result); intent.putExtra(ImportKeyResult.EXTRA_RESULT, result);
ImportKeysActivity.this.setResult(RESULT_OK, intent); ImportKeysActivity.this.setResult(RESULT_OK, intent);
@ -475,11 +476,6 @@ public class ImportKeysActivity extends ActionBarActivity {
ImportKeysActivity.this.finish(); ImportKeysActivity.this.finish();
return; return;
} }
if (ACTION_IMPORT_KEY_FROM_FILE_AND_RETURN.equals(getIntent().getAction())) {
ImportKeysActivity.this.setResult(RESULT_OK);
ImportKeysActivity.this.finish();
return;
}
result.createNotify(ImportKeysActivity.this).show(); result.createNotify(ImportKeysActivity.this).show();
} }