Serializable crash error when loading web broser from my application

前端 未结 3 1570
醉话见心
醉话见心 2021-01-23 16:48

I\'m developing an application.

This application contains 2 classes

  • Discovery class which implements serializable

  • Main class which exten

相关标签:
3条回答
  • 2021-01-23 17:06

    As far as I know Serializable is slow on Android, you should use Parcelable instead, see this link for more info: Benefit of using Parcelable instead of serializing object

    Regards

    0 讨论(0)
  • 2021-01-23 17:25

    the problem is due to pass main activity to serializable class when creating its related object. in our case passing the MainTest Object to the Discovery object when creating it. The solution: create another serializable class which contains all Discovery data (data to be serialzable).

    0 讨论(0)
  • 2021-01-23 17:28

    The error is pretty clear: Caused by: java.io.NotSerializableException: android.os.Handler

    Figure out how to take the handler out: android.os.Handler handler = new android.os.Handler();

    0 讨论(0)
提交回复
热议问题