ilan Expert Licensed User Longtime User Dec 8, 2016 #1 hi i just noticed that when i am in my app and i click the Power Button then the Activity_Pause event will be raised and after a short time the Activity_Create (+ activity_Resume) events will be raised. why is it like that? clicking on the HOME button will only call Activity_Pause. thanx, ilan Last edited: Dec 8, 2016
hi i just noticed that when i am in my app and i click the Power Button then the Activity_Pause event will be raised and after a short time the Activity_Create (+ activity_Resume) events will be raised. why is it like that? clicking on the HOME button will only call Activity_Pause. thanx, ilan
Erel B4X founder Staff member Licensed User Longtime User Dec 8, 2016 #2 It is related to the screen orientation. Is your app in landscape mode? Upvote 0
ilan Expert Licensed User Longtime User Dec 8, 2016 #3 Yes it is. what can i do to avoid an avtivity_create call after power button was pressed Thanx Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Dec 8, 2016 #4 Check this: https://www.b4x.com/android/forum/t...d-when-phone-goes-to-sleep.43863/#post-266970 (my post not the incorrect solution) Upvote 0
Check this: https://www.b4x.com/android/forum/t...d-when-phone-goes-to-sleep.43863/#post-266970 (my post not the incorrect solution)
ilan Expert Licensed User Longtime User Dec 8, 2016 #5 so there is nothing i can do? btw i am using Android 6.0.1 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Dec 9, 2016 #6 I wasn't able to reproduce it here on a device running Android 7. Does it happen with a new project with: #SupportedOrientations set to landscape ? Upvote 0
I wasn't able to reproduce it here on a device running Android 7. Does it happen with a new project with: #SupportedOrientations set to landscape ?
ilan Expert Licensed User Longtime User Dec 9, 2016 #7 Erel said: Does it happen with a new project with: #SupportedOrientations set to landscape ? Click to expand... yes! Erel said: I wasn't able to reproduce it here on a device running Android 7. Click to expand... here is a simple example that always do the same on my samsung s5 (android 6.0.1) * open app = [activity_create > activity_resume] * close app via home button = [activity_pause] * open app again [activity_resume] * close app via Power button [activity_pause > activity_create > activity_resume] EDIT: i am using b4a 6.31 Attachments test1.zip test1.zip 1.9 KB · Views: 483 Upvote 0
Erel said: Does it happen with a new project with: #SupportedOrientations set to landscape ? Click to expand... yes! Erel said: I wasn't able to reproduce it here on a device running Android 7. Click to expand... here is a simple example that always do the same on my samsung s5 (android 6.0.1) * open app = [activity_create > activity_resume] * close app via home button = [activity_pause] * open app again [activity_resume] * close app via Power button [activity_pause > activity_create > activity_resume] EDIT: i am using b4a 6.31
ilan Expert Licensed User Longtime User Dec 9, 2016 #8 btw adding this line: Code: SetActivityAttribute(Main, android:configChanges, "orientation|keyboardHidden|screenSize") will solve the problem. i understand why you said it is incorrect solution because like this no orientation change event will called whenever it will change but in my case it doesnot matter since i am using only landscape mode in my game. Upvote 0
btw adding this line: Code: SetActivityAttribute(Main, android:configChanges, "orientation|keyboardHidden|screenSize") will solve the problem. i understand why you said it is incorrect solution because like this no orientation change event will called whenever it will change but in my case it doesnot matter since i am using only landscape mode in my game.