T ThePlankton Member Licensed User Longtime User Sep 30, 2020 #1 I'm having the strangest issue. I have a Honeywell CT-60 with android 7. I'm using B4A 8.80 When my app has focus, so main activity is visible if I remove the device from power or plug it in the activity is destroyed and recreated I've seen nothing about this in the android life cycle. I can reproduce with an empty project no code added release mode or debug. This seems to be causing a lot of issues in our deployment. Any help would be appreciated Edit: Just tested with CT-60 Android 8, same issue Last edited: Sep 30, 2020
I'm having the strangest issue. I have a Honeywell CT-60 with android 7. I'm using B4A 8.80 When my app has focus, so main activity is visible if I remove the device from power or plug it in the activity is destroyed and recreated I've seen nothing about this in the android life cycle. I can reproduce with an empty project no code added release mode or debug. This seems to be causing a lot of issues in our deployment. Any help would be appreciated Edit: Just tested with CT-60 Android 8, same issue
aeric Expert Licensed User Longtime User Oct 1, 2020 #2 Why don’t you update to the latest version of B4A? It is free. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 1, 2020 #3 All kinds of things can cause your activity to be recreated. The power state shouldn't cause that. It sounds like a device bug. Maybe it is somehow related to an external keyboard state: https://developer.android.com/guide/topics/manifest/activity-element#config Try to find the configuration change that causes it. Start with: Code: Copy SetActivityAttribute(Main, android:configChanges, "keyboard|keyboardHidden") Add more components until it will hopefully stop. Upvote 0
All kinds of things can cause your activity to be recreated. The power state shouldn't cause that. It sounds like a device bug. Maybe it is somehow related to an external keyboard state: https://developer.android.com/guide/topics/manifest/activity-element#config Try to find the configuration change that causes it. Start with: Code: Copy SetActivityAttribute(Main, android:configChanges, "keyboard|keyboardHidden") Add more components until it will hopefully stop.
T ThePlankton Member Licensed User Longtime User Oct 1, 2020 #4 This did the trick, thank you so much B4X: Copy SetActivityAttribute(Main, android:configChanges, "uiMode") Upvote 0
This did the trick, thank you so much B4X: Copy SetActivityAttribute(Main, android:configChanges, "uiMode")