Unmarshalling unknown type code exception while reading parcel values in Android 4.4+

StackOverflow https://stackoverflow.com/questions/23217078

  •  07-07-2023
  •  | 
  •  

문제

I'm using Parcelable interface and its working fine till Android 4.3 (Jelly Bean) but when I install same app on a device running under Android 4.4+ (Kitkat) then its crashing while reading from parcel. Its throwing below error :

 java.lang.RuntimeException: Parcel android.os.Parcel@42acce90: Unmarshalling unknown type code 6881383 at offset 1864

When try to read :

getIntent().getExtras().getString("TYPE").contains("SOME_TYPE");

I have put extra in intent like this :

 Intent oIntent = new Intent(getActivity().getApplicationContext(), EventFragment.class);
 oIntent.putExtra("TYPE", "SOME_TYPE");
도움이 되었습니까?

해결책

After a long time and much R&D, I came to know that we should not use ArrayList inside another ArrayList, within a Parcelable object. It is causing the issue.

So I end-up with using Serializable interface provided by JAVA, as both concept are same.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top