在使用 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,操作一样。