Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit ec0b923

Browse files
committed
Possible fix for the stupid IllegalStateException bug (issue #21) that I am hunting since December. Needs testing.
1 parent 23f44ba commit ec0b923

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

app/src/main/java/org/y20k/transistor/MainActivity.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import android.content.Intent;
1717
import android.os.Bundle;
18+
import android.support.v4.app.Fragment;
1819
import android.support.v7.app.AppCompatActivity;
1920
import android.view.Menu;
2021
import android.view.MenuInflater;
@@ -50,4 +51,11 @@ public boolean onCreateOptionsMenu(Menu menu) {
5051
}
5152

5253

54+
@Override
55+
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
56+
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_main);
57+
// hand results over to fragment main
58+
fragment.onActivityResult(requestCode, resultCode, data);
59+
}
60+
5361
}

app/src/main/java/org/y20k/transistor/MainActivityFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ private void selectFromImagePicker() {
479479

480480
// get system picker for images
481481
Intent pickImageIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
482-
startActivityForResult(pickImageIntent, REQUEST_LOAD_IMAGE);
482+
mActivity.startActivityForResult(pickImageIntent, REQUEST_LOAD_IMAGE);
483483
}
484484
// permission to read external storage not granted
485485
else {

0 commit comments

Comments
 (0)