Exception information:
uncaughtexception detected: java.lang.runtimeexception: separable accounted IOException writing serializable object
causes
When transferring data between activities, there is a problem in implementing serializable interface
Entity class
public class GoodsBean implements Serializable {
private String createtime;
private String images;
private int clickCount;
private UniUserBean uniUser;
private String mobile;
private String description;
private int catId;
private int createid;
private double price;
private String name;
private int id;
private int status;
Second Activity
private void exit4Goods(int position) {
if (mGoodLists != null) {
GoodsBean goodsBean = mGoodLists.get(position);
Intent data = new Intent();
data.putExtra("goodsBean", goodsBean);
setResult(ConstantValues.ACTIVITY_SELECT_GOODS_SUCCESS_CODE, data);
}
}
First Activity
if (resultCode == ConstantValues.ACTIVITY_SELECT_GOODS_SUCCESS_CODE) {
if (data != null) {
GoodsBean goodsBean = (GoodsBean) data.getSerializableExtra("goodsBean");
}
}
solutions
The entity class goodsbean refers to the uniuserbean, so we should not only serialize the goodsbean, but also the uniuserbean
Similar Posts:
- Kotlin Viewpager+fragment error: java.lang.IllegalStateException: Fragment already added
- [Solved] The activity must be exported or contain an intent-filter
- [Solved] Android Studio Warning: Default Activity not found
- Android Studio 3 Error Message: The activity must be exported or contain an intent-filter
- [Solved] C# The type or namespace name ‘DllImport’ could not be found
- [Solved] org.hibernate.AnnotationException: No identifier specified for entity: com.example1.demo1.Entity….
- java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.ba.cal
- [Solved] UserInfo()’ in ‘com.example.gmall.cart.pojo.UserInfo’ cannot be applied to ‘(long, java.lang.String)’
- Service Intent must be explicit solution: continued
- Warning: The serializable class * does not declare a static final serialVersionUID