File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ public static void PickMedia( Context context, final NativeGalleryMediaReceiver
333333
final Fragment request = new NativeGalleryMediaPickerFragment( mediaReceiver );
334334
request.setArguments( bundle );
335335

336-
( (Activity) context ).getFragmentManager().beginTransaction().add( 0, request ).commit();
336+
( (Activity) context ).getFragmentManager().beginTransaction().add( 0, request ).commitAllowingStateLoss();
337337
}
338338

339339
@TargetApi( Build.VERSION_CODES.M )
@@ -384,7 +384,7 @@ public static void RequestPermission( Context context, final NativeGalleryPermis
384384
final Fragment request = new NativeGalleryPermissionFragment( permissionReceiver );
385385
request.setArguments( bundle );
386386

387-
( (Activity) context ).getFragmentManager().beginTransaction().add( 0, request ).commit();
387+
( (Activity) context ).getFragmentManager().beginTransaction().add( 0, request ).commitAllowingStateLoss();
388388
}
389389

390390
// Credit: https://stackoverflow.com/a/35456817/2373034
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ else if( resultCode != Activity.RESULT_OK || data == null )
163163
}
164164

165165
if( resultFragment == null )
166-
getFragmentManager().beginTransaction().remove( this ).commit();
166+
getFragmentManager().beginTransaction().remove( this ).commitAllowingStateLoss();
167167
else
168-
getFragmentManager().beginTransaction().remove( this ).add( 0, resultFragment ).commit();
168+
getFragmentManager().beginTransaction().remove( this ).add( 0, resultFragment ).commitAllowingStateLoss();
169169
}
170170
}
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void onRequestPermissionsResult( int requestCode, String[] permissions, i
7979
{
8080
Log.e( "Unity", "Fragment data got reset while asking permissions!" );
8181

82-
getFragmentManager().beginTransaction().remove( this ).commit();
82+
getFragmentManager().beginTransaction().remove( this ).commitAllowingStateLoss();
8383
return;
8484
}
8585

@@ -107,7 +107,7 @@ public void onRequestPermissionsResult( int requestCode, String[] permissions, i
107107
}
108108

109109
permissionReceiver.OnPermissionResult( result );
110-
getFragmentManager().beginTransaction().remove( this ).commit();
110+
getFragmentManager().beginTransaction().remove( this ).commitAllowingStateLoss();
111111

112112
// Resolves a bug in Unity 2019 where the calling activity
113113
// doesn't resume automatically after the fragment finishes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= Native Gallery for Android & iOS (v1.7.6) =
1+
= Native Gallery for Android & iOS (v1.7.7) =
22

33
Documentation: https://.com/yasirkula/UnityNativeGallery
44
FAQ: https://.com/yasirkula/UnityNativeGallery#faq
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.yasirkula.nativegallery",
33
"displayName": "Native Gallery",
4-
"version": "1.7.6",
4+
"version": "1.7.7",
55
"documentationUrl": "https://.com/yasirkula/UnityNativeGallery",
66
"changelogUrl": "https://.com/yasirkula/UnityNativeGallery/releases",
77
"licensesUrl": "https://.com/yasirkula/UnityNativeGallery/blob/master/LICENSE.txt",

0 commit comments

Comments
 (0)