0

I am trying to get Image from Gallery in fragment. Following is the line of code I am using to get Image from Gallery.

Intent intent1 = new Intent(Intent.ACTION_PICK,
                    android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
            getActivity().startActivityForResult(intent1, 1);

I am getting this particular crash in only nougat device and the same piece of code is working fine for other android version. Following is the error that I am getting in nougat

java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 1314264 bytes
                                                                      at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3850)
                                                                      at android.os.Handler.handleCallback(Handler.java:754)
                                                                      at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                      at android.os.Looper.loop(Looper.java:163)
                                                                      at android.app.ActivityThread.main(ActivityThread.java:6342)
                                                                      at java.lang.reflect.Method.invoke(Native Method)
                                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)

Kindly please someone help me out with this issue.

Mehdi
  • 103
  • 1
  • 8
  • https://developer.android.com/reference/android/os/TransactionTooLargeException – terencey Jul 05 '18 at 06:17
  • @squeeish How to resolve this inbuilt code? – Mehdi Jul 05 '18 at 06:18
  • You'll need to do some googling. This is the first result I got when I searched. https://medium.com/@mdmasudparvez/android-os-transactiontoolargeexception-on-nougat-solved-3b6e30597345 – terencey Jul 05 '18 at 06:20
  • Possible duplicate of [What to do on TransactionTooLargeException](https://stackoverflow.com/questions/11451393/what-to-do-on-transactiontoolargeexception) – Mr. Roshan Jul 05 '18 at 06:22

0 Answers0