1

I have to save Strings and Integers into a Bundle in onSavedInstanceState() so when the screen orientation changes it will continue where it left off in the other orientation.

Is is possible to store more complex objects like an instance of Handler into a Bundle? How can this be done?

Kevik
  • 9,181
  • 19
  • 92
  • 148

1 Answers1

0

You can check the documentation of Bundle to see which data type you can put into. Normally the object you can put into a Bundle must be primitive data types like int, float, double…; or must implement Serializable/ Parcelable. Handler just extends Object so you cannot put it into a Bundle.

You can search for other solutions like:

Community
  • 1
  • 1