I'm trying to get a MapView to work inside a Controller but I'm having trouble setting it up. MapView has to be bound to Activity/Fragment lifecycle to work properly.
Since a Controller lifecycle is different than that of its host Activity I can't use onActivity* callbacks (not that I haven't tried).
Calling MapView.onStart() and MapView.onResume() inside onAttach() doesn't work either. I'm wondering what should I do?
I think this was explained pretty well in #109. For a quick summary, use a RestoreViewOnCreateController, which allows you to get the view state bundle in onCreateView. The methods map as such:
onCreateView -> create the mapview, then call onCreate on it
onAttach -> call onResume
onDetach -> call onPause
onDestroyView -> call onDestroy
onSaveViewState -> call onSaveInstanceState
For onLowMemory, see this issue: #59
Most helpful comment
I think this was explained pretty well in #109. For a quick summary, use a
RestoreViewOnCreateController, which allows you to get the view state bundle inonCreateView. The methods map as such:onCreateView-> create the mapview, then call onCreate on itonAttach-> callonResumeonDetach-> callonPauseonDestroyView-> callonDestroyonSaveViewState-> callonSaveInstanceStateFor
onLowMemory, see this issue: #59