Android Question Note 8 vs Note 4 program issues

GaryK4

Member
Licensed User
Longtime User
I developed a Golf app that I have been running since my Note 4 (V 6.0.1). When I run it on my Note 8 (v 7.1.1), I see a lot of differences that I am trying to work around. I would appreciate any feedback.
Typically, when I finish a hole, I enter in the scores for each player, then press the power button to turn the screen off (save power). On both phone Lock instantly with power key is OFF.
  • With the N4 pressing the power key on/off did not trigger the Activity_Resume, but N8 does.
  • Once in a while, the N8 closes and I have to use the task list key to bring the program back.
  • The program is Landscape only. On the N8, when I press power on, it briefly display in portrait, then flips to landscape. This does not happen with the N4.
I never changed the targetSdkVersion=14. Should I have?

Am I doing something wrong or are these normal OS changes that I have to live with?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I never changed the targetSdkVersion=14. Should I have?
It shouldn't matter.

The issue you describe is related to the app being a landscape app. On some devices it causes the activity to be recreated.
If your app is built correctly then it shouldn't really matter. You should save the UI state in Activity_Pause and set it back in Activity_Create. You can use StateManager to help you with this.
 
Upvote 0
Top