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,能够解决的给高分+人民币

解决方案 »

  1.   

    序列化错误,看看是不是mChatService木有实现序列化接口?
      

  2.   

    其实你根本不需要这样传递对象。
    你还可以考虑:
    1,把对象抛入Application中去。然后通过getApplication()去获取。
    2,使用public static 传递。记得自己回收。
    3,你也可以尝试实现Parcelable接口试试。
      

  3.   


    你既然实现序列化了为什么不能过将对象通过流的方式传送过去?
    new ObjectOutputStream(output).writeObject(mChatService);
    然后那边在读
      

  4.   

    mChatService  implments  serizf