Android Question [Solved] Power bug?

ThePlankton

Member
Licensed User
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:

Erel

B4X founder
Staff member
Licensed User
Longtime User
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:
B4X:
SetActivityAttribute(Main, android:configChanges, "keyboard|keyboardHidden")
Add more components until it will hopefully stop.
 
Upvote 0
Top