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
更多相关文章
- 高级Redis应用进阶课 一站式Redis解决方案
- Android(java)学习笔记68:同步代码块的锁和同步方法的应用
- android postDelayed 方法的简单使用
- android下高效率的J2ME API之Graphics.drawRegion
- Android异步线程与Bundle消息传递
- Android(安卓)WebView 中 JS 与Java之间通信
- Android(安卓)常用技术框架的基本使用
- 更新UI时遇到:Only the original thread that created a view hie
- Android应用程序打包时,出现错误:Android(安卓)Lint "app_name" i