I have a ListView that look at a list of my protobuf object. When the user click on an item in the ListView, I want to show the details of that object. Currently, I am implementing this as a separate activity. Before I start the activity, I need to pass in the object data.
Should I serialize my protobuf object and pass it in the child activity? The child activity will have to deserialize the protobuf object.
Or should I provide some kind of accessor for my child activity to modify private fields of the parent activity?
Yeah this is the way to go, 🙂 … or you can use Parcelable. Another option is to extend the Application class and have it store the
protobufdata. This data will be accessible in all of your Activities.No this is a bad idea