Android app crashes if the orientation changes

前端 未结 1 1729
没有蜡笔的小新
没有蜡笔的小新 2021-01-28 06:20

I have created a game app where I share some details to Facebook through a button called Share. When I finish the game it asks for the name in a dialog box, it shows no problem

相关标签:
1条回答
  • 2021-01-28 06:51

    An activity is restarted when the orientation changes. I'm guessing your code isn't saving needed information before this restart occurs. You can stop this default behavior by handling specific configuration changes yourself (ie: orientation change). A good tutorial on doing this is located here: Handling Runtime Changes

    0 讨论(0)
提交回复
热议问题