HashMap myMap = (HashMap) getLastNonConfigurationInstance();
myMap is always null. getLastNonConfigurationInstance() returns an object. My map has two keys "symbol" and "name".
public Object onRetainNonConfigurationInstance()
{
HashMap myMap = new HashMap();
myMap.put("symbol", this.symbol);
final Object data = myMap;
return data;
}
I faced the same issue. Looks like calling getLastNonConfigurationInstance() in anything other than onCreate() returns null. I moved the statement to onCreate() method and voila..it returned what I expected it to return.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With