How To Implement Parcelable Object For My Class?
I have class which is used to create Client that connects to a Server. It has the following members: public class MyClientThread implements Runnable, Parcelable { private Text
Solution 1:
How to parcel Socket and Thread class object and such?
You can't.
When the user rotates the screen, all the client object data is lost/reset and the client has to be reconnected with server.
Use a retained fragment, or onRetainNonConfigurationInstance()
, or something based off of the lifecycle architecture components (e.g., possibly LiveData
), to retain this across configuration changes.
Post a Comment for "How To Implement Parcelable Object For My Class?"