1

When I send HashMap with size more than 20 in android 4.1, I get crash with this log:

10-02 13:13:05.068: ERROR/AndroidRuntime(938): FATAL EXCEPTION: main
        java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy@41bbb490 (pid=938) when publishing content providers
        at android.os.Parcel.readException(Parcel.java:1425)
        at android.os.Parcel.readException(Parcel.java:1379)
        at android.app.ActivityManagerProxy.publishContentProviders(ActivityManagerNative.java:2392)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:4199)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4132)
        at android.app.ActivityThread.access$1300(ActivityThread.java:130)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4745)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
        at dalvik.system.NativeStart.main(Native Method)

What I do for that:

Intent intent = new Intent(MyActions.PREVIEWS);
HashMap<String, Bitmap> thumbnails = new HashMap<String, Bitmap>();
// added more than 20 items
intent.putExtra("previews", thumbnails);
setResult(RESULT_OK, intent);
finish();
Rusfearuth
  • 3,261
  • 5
  • 28
  • 37

2 Answers2

2

You should save Bitmaps into files and pass their references to another activity. Extra's bundle size has limitations : https://groups.google.com/forum/?fromgroups=#!topic/android-developers/kwmTGz8GAoQ

Answer on this question also should help

Community
  • 1
  • 1
amukhachov
  • 5,822
  • 1
  • 41
  • 60
0

You're probably exceeding the amount of data you can send in an Intent

MrChaz
  • 1,065
  • 1
  • 8
  • 17