Intent intent = new Intent();
Bundle bundle = new Bundle();
bundle.putSerializable("service", (Serializable) mChatService);
intent.putExtras(bundle);提示bundle.putSerializable这句出错,错误提示为,can not cast to java.io.serializable。现在急于解决这个问题,请能解决的,和我联系 QQ 277602276,能够解决的给高分+人民币
Bundle bundle = new Bundle();
bundle.putSerializable("service", (Serializable) mChatService);
intent.putExtras(bundle);提示bundle.putSerializable这句出错,错误提示为,can not cast to java.io.serializable。现在急于解决这个问题,请能解决的,和我联系 QQ 277602276,能够解决的给高分+人民币
你还可以考虑:
1,把对象抛入Application中去。然后通过getApplication()去获取。
2,使用public static 传递。记得自己回收。
3,你也可以尝试实现Parcelable接口试试。
你既然实现序列化了为什么不能过将对象通过流的方式传送过去?
new ObjectOutputStream(output).writeObject(mChatService);
然后那边在读