0

I am working on application that shows list of images from specific folder to gridview. It is working fine in all devices but getting crashed while I am trying to test it in nexus 7" tablet.

Following is the crash log that I get.

05-05 10:54:02.478  4246  4246 W Bundle  : Key android.intent.extra.TEXT expected ArrayList<CharSequence> but value was a java.lang.String.  The default value <null> was returned.
05-05 10:54:02.488  4246  4246 W Bundle  : Attempt to cast generated internal exception:
05-05 10:54:02.488  4246  4246 W Bundle  : java.lang.ClassCastException: java.lang.String cannot be cast to java.util.ArrayList
05-05 10:54:02.488  4246  4246 W Bundle  :  at android.os.Bundle.getCharSequenceArrayList(Bundle.java:1334)
05-05 10:54:02.488  4246  4246 W Bundle  :  at android.content.Intent.getCharSequenceArrayListExtra(Intent.java:4414)
05-05 10:54:02.488  4246  4246 W Bundle  :  at android.content.Intent.migrateExtraStreamToClipData(Intent.java:6872)
05-05 10:54:02.488  4246  4246 W Bundle  :  at android.content.Intent.migrateExtraStreamToClipData(Intent.java:6840)
05-05 10:54:02.488  4246  4246 W Bundle  :  at android.app.Instrumentation.execStartActivity(Instrumentation.java:1411)
05-05 10:54:02.488  4246  4246 W Bundle  :  at android.app.Activity.startActivityForResult(Activity.java:3370)
05-05 10:54:02.488  4246  4246 W Bundle  :  at android.app.Activity.startActivityForResult(Activity.java:3331)
05-05 10:54:02.488  4246  4246 W Bundle  :  at android.app.Activity.startActivity(Activity.java:3566)
05-05 10:54:02.488  4246  4246 W Bundle  :  at android.app.Activity.startActivity(Activity.java:3534)
05-05 10:54:02.488  4246  4246 W Bundle  :  at com.mxtech.logcollector.ActivityCollector.collectAndSend(ActivityCollector.java:354)
05-05 10:54:02.488  4246  4246 W Bundle  :  at com.mxtech.logcollector.ActivityCollector.onClick(ActivityCollector.java:364)
05-05 10:54:02.488  4246  4246 W Bundle  :  at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166)
05-05 10:54:02.488  4246  4246 W Bundle  :  at android.os.Handler.dispatchMessage(Handler.java:99)
05-05 10:54:02.488  4246  4246 W Bundle  :  at android.os.Looper.loop(Looper.java:137)
05-05 10:54:02.488  4246  4246 W Bundle  :  at android.app.ActivityThread.main(ActivityThread.java:5041)
05-05 10:54:02.488  4246  4246 W Bundle  :  at java.lang.reflect.Method.invokeNative(Native Method)
05-05 10:54:02.488  4246  4246 W Bundle  :  at java.lang.reflect.Method.invoke(Method.java:511)
05-05 10:54:02.488  4246  4246 W Bundle  :  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
05-05 10:54:02.488  4246  4246 W Bundle  :  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
05-05 10:54:02.488  4246  4246 W Bundle  :  at dalvik.system.NativeStart.main(Native Method)
Alexis C.
  • 91,686
  • 21
  • 171
  • 177
Alex
  • 165
  • 1
  • 9

1 Answers1

0

Looks like some AutoBoxing Problem when an Cast to NULL is made. Try to use an Default Value!

Kitesurfer
  • 3,438
  • 2
  • 29
  • 47