Parcelable encountered IOException writing serializable object getactivity()

前端 未结 12 1853
故里飘歌
故里飘歌 2020-11-29 22:15

so I am getting this in logcat:

java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.resources.student_list         


        
12条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 22:25

    For me this was resolved by making the variable withing the class transient.

    Code before:

    public class UserLocation implements Serializable {
       public Location lastKnownLocation;
       public UserLocation() {}
    }
    

    code after

    public class UserLocation implements Serializable {
        public transient Location lastKnownLocation;
        public UserLocation() {}
    }   
    

提交回复
热议问题