This is necessary because MainActivity can be recreated with a saved bundle in two different cases:
on orientation changes, when only the activity is recreated
after the process has been killed, when both activity and application are recreated
In the first case, mMapIndex = application.getExtraMapIndex() worked well,
though in the second case, MapTrek.mExtraMapIndex got cleared and maps from content providers hadn't had any chance to get initialized up to now.
I'm not sure if the approach I adopted will be fine with you. Unfortunately, plugin management cannot satisfactorily be restricted to BasePluginActivity because plugins must be initialized on application startup, not when the activity is created.
This is necessary because MainActivity can be recreated with a saved bundle in two different cases:
In the first case, mMapIndex = application.getExtraMapIndex() worked well, though in the second case, MapTrek.mExtraMapIndex got cleared and maps from content providers hadn't had any chance to get initialized up to now.
I'm not sure if the approach I adopted will be fine with you. Unfortunately, plugin management cannot satisfactorily be restricted to
BasePluginActivity
because plugins must be initialized on application startup, not when the activity is created.