0

I have a Google Map on one of my fragments, however when I try to change to orientation (to landscape) the app force stops. What is the possible cause and solution for this? I have tried enforcing a portrait orientation bu I think that is bad practice.

Jeongbebs
  • 4,100
  • 7
  • 34
  • 60
  • enforcing portrait is not a bad practice, there are some apps that are meant only to be used in the portrait mode. and the crash takes place because on config changes the entire activity is recreated. in that case override the onConfig changes method and do what you want to do with the changes there – Rat-a-tat-a-tat Ratatouille Oct 14 '13 at 09:39
  • how can i force the onconfig changes? – Jeongbebs Oct 14 '13 at 09:58
  • please refer to http://developer.android.com/guide/topics/resources/runtime-changes.html and also http://mrbool.com/how-to-manage-screen-configuration-in-android/26879, and http://www.androiddesignpatterns.com/2013/04/retaining-objects-across-config-changes.html – Rat-a-tat-a-tat Ratatouille Oct 14 '13 at 10:07
  • okay. will take time to read. – Jeongbebs Oct 16 '13 at 00:41

0 Answers0