@@ -95,7 +95,7 @@ public void startGalleryPick() {
95
95
96
96
public void handleImagePicked (int requestCode , @ Nullable Uri uri , boolean isDirectUpload , String wikiDataEntityId ) {
97
97
FragmentActivity activity = fragment .getActivity ();
98
- Timber .d ("handleImagePicked() called with onActivityResult()" );
98
+ Timber .d ("handleImagePicked() called with onActivityResult(). Boolean isDirectUpload: " + isDirectUpload + "String wikiDataEntityId: " + wikiDataEntityId );
99
99
Intent shareIntent = new Intent (activity , ShareActivity .class );
100
100
shareIntent .setAction (ACTION_SEND );
101
101
switch (requestCode ) {
@@ -113,21 +113,26 @@ public void handleImagePicked(int requestCode, @Nullable Uri uri, boolean isDire
113
113
shareIntent .setType ("image/jpeg" );
114
114
shareIntent .putExtra (EXTRA_STREAM , lastGeneratedCaptureUri );
115
115
shareIntent .putExtra (EXTRA_SOURCE , SOURCE_CAMERA );
116
-
117
116
break ;
118
117
default :
119
118
break ;
120
119
}
120
+
121
121
Timber .i ("Image selected" );
122
+ shareIntent .putExtra ("isDirectUpload" , isDirectUpload );
123
+ Timber .d ("Put extras into image intent, isDirectUpload is " + isDirectUpload );
124
+
122
125
try {
123
- shareIntent .putExtra ("isDirectUpload" , isDirectUpload );
124
126
if (wikiDataEntityId != null && !wikiDataEntityId .equals ("" )) {
125
127
shareIntent .putExtra (WIKIDATA_ENTITY_ID_PREF , wikiDataEntityId );
126
128
}
127
- activity .startActivity (shareIntent );
128
129
} catch (SecurityException e ) {
129
130
Timber .e (e , "Security Exception" );
130
131
}
132
+
133
+ if (activity != null ) {
134
+ activity .startActivity (shareIntent );
135
+ }
131
136
}
132
137
133
138
void saveState (Bundle outState ) {
0 commit comments