Note that there are some explanatory texts on larger screens.

plurals
  1. PONested Parcelling : RuntimeException - Unmarshalling unknown type code 3211319 at offset 440
    primarykey
    data
    text
    <p>I need to send some data to an <code>Activity</code>, which may be running in different context. For this I created a class say A, which has an <code>ArrayList</code> of datatype say B as its one of instance member . I declared class B as Class A's Inner class. To send this class A's instance through <code>Intent</code>, I made class A and B both <code>Parcelable</code>. </p> <p>Class structure is something like this (this does not include the complete code e.g. code written to make the classes <code>Parcelable</code>):</p> <pre><code>public class A implements Parcelable{ public class B implements Parcelable{ public ArrayList&lt;String&gt; value; .... .... public void writeToParcel(Parcel dest, int flags) { dest.writeList(value); } .... .... } public List&lt;B&gt; group; public String name; .... .... public void writeToParcel(Parcel dest, int flags) { dest.writeList(group); dest.writeString(name); } .... .... } </code></pre> <p>I used the <code>putExtra (String name, Parcelable value)</code> function to put data.</p> <p>But on the receiving side, I got the following exception:</p> <pre><code> Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 1087): 1289817569622 java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.SET_VOIP_SUPP_SERVICE_REQUEST_LOCAL (has extras) } in com.hsc.example.android.MyApp.MyAppActuvity$1@43b409b0 E/AndroidRuntime( 1087): at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:765) E/AndroidRuntime( 1087): at android.os.Handler.handleCallback(Handler.java:587) E/AndroidRuntime( 1087): at android.os.Handler.dispatchMessage(Handler.java:92) E/AndroidRuntime( 1087): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 1087): at android.app.ActivityThread.main(ActivityThread.java:4363) E/AndroidRuntime( 1087): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 1087): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime( 1087): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) E/AndroidRuntime( 1087): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) E/AndroidRuntime( 1087): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 1087): Caused by: java.lang.RuntimeException: Parcel android.os.Parcel@43b51240: Unmarshalling unknown type code 3211319 at offset 440 E/AndroidRuntime( 1087): at android.os.Parcel.readValue(Parcel.java:1777) E/AndroidRuntime( 1087): at android.os.Parcel.readListInternal(Parcel.java:1956) E/AndroidRuntime( 1087): at android.os.Parcel.readList(Parcel.java:1302) E/AndroidRuntime( 1087): at com.hsc.example.android.MyApp.A.&lt;init&gt;(A.java:61) E/AndroidRuntime( 1087): at com.hsc.example.android.MyApp.A.&lt;init&gt;(A.java:57) E/AndroidRuntime( 1087): at com.hsc.example.android.MyApp.A$1.createFromParcel(A.java:67) E/AndroidRuntime( 1087): at com.hsc.example.android.MyApp.A$1.createFromParcel(A.java:1) E/AndroidRuntime( 1087): at android.os.Parcel.readParcelable(Parcel.java:1845) E/AndroidRuntime( 1087): at android.os.Parcel.readValue(Parcel.java:1713) E/AndroidRuntime( 1087): at android.os.Parcel.readMapInternal(Parcel.java:1947) E/AndroidRuntime( 1087): at android.os.Bundle.unparcel(Bundle.java:169) E/AndroidRuntime( 1087): at android.os.Bundle.getParcelable(Bundle.java:1037) E/AndroidRuntime( 1087): at android.content.Intent.getParcelableExtra(Intent.java:3269) E/AndroidRuntime( 1087): at com.hsc.example.android.MyApp.MyAppActuvity$1.onReceive(MyAppActuvity.java:219) E/AndroidRuntime( 1087): at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:754) E/AndroidRuntime( 1087): ... 9 more </code></pre> <p>Then I moved the class B, outside the class A (As I thought this may be problem of inner class, and declared the CREATOR static. This static declaration was not present when class B was an inner class of Class A). But it did not helped.</p> <p>This seems that this problem is due to nested Parceling.</p> <p>Any suggestion ??</p> <p><strong>NOTE</strong>: when I used <code>android.os.Bundle.putParcelable(String key, Parcelable value)</code> function of Bundle class, and then unmarshalled it using <code>android.os.Bundle.getParcelable(String key)</code> then everything is fine. So it seems that the problem is with respect to Intents only.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload