Commit 13ba1ca3 authored by Roumen Petrov's avatar Roumen Petrov

add missing calls to super on activity result

parent b80116c5
......@@ -12,6 +12,7 @@
import com.google.android.material.snackbar.Snackbar;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
......@@ -159,12 +160,13 @@ private void requestPermissionRunScript() {
REQUEST_PERMISSION_RUN_SCRIPT);
}
protected void onActivityResult(int request, int result, Intent data) {
if (result != RESULT_OK) {
return;
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode != RESULT_OK) return;
if (request == REQUEST_WINDOW_HANDLE && data != null) {
if (requestCode == REQUEST_WINDOW_HANDLE && data != null) {
mHandle = data.getStringExtra(ARGUMENT_WINDOW_HANDLE);
((Button) findViewById(R.id.runScriptSaveWindow)).setText(
R.string.run_script_existing_window);
......
......@@ -602,10 +602,15 @@ private void doCloseWindow() {
}
@Override
protected void onActivityResult(int request, int result, Intent data) {
switch (request) {
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode != RESULT_OK) return;
//noinspection SwitchStatementWithTooFewBranches
switch (requestCode) {
case REQUEST_CHOOSE_WINDOW:
if (result == RESULT_OK && data != null) {
if (data != null) {
int position = data.getIntExtra(Application.ARGUMENT_WINDOW_ID, -2);
if (position >= 0) {
// Switch windows after session list is in sync, not here
......@@ -637,7 +642,8 @@ protected void onActivityResult(int request, int result, Intent data) {
finish();
}
}
break;
//noinspection UnnecessaryReturnStatement
return;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment