Android Parcelable 错误 Parcel: Class not found when unmarshalling

在使用 Parcelable在activity之间传递对象的时候有些系统会报 Parcel: Class not found when unmarshalling错误

并且提示 “xx.xxxxx.xxx” ClassNoFound

具体原因尚未调查

解决方案:

1. Intent intent= new Intent(this,XXXActivity.class);

Bundle bundle = new Bundle();

bundle.putParcelable("data",xxxValue);

intent.setExtrasClassLoader(XxxValue.class.getClassLoader());

intent.putExtras(bundle);

startActivity(intent)

/

getIntent().getExtras().getParcelable("data") 

2. 

Intent intent= new Intent(this,XXXActivity.class);

Bundle bundle = new Bundle();

bundle.putParcelable("data",xxxValue);

intent.putExtra("data",bundle);

startActivity(intent)

/

getIntent().getBundleExtra("data").getParcelable("data") 

 

如果是list,操作一样。

参考内容:https://stackoverflow.com/questions/28589509/android-e-parcel-class-not-found-when-unmarshalling-only-on-samsung-tab3

你可能感兴趣的:(错误解决,android)