Android Question Bluetooth keyboard causes Activity Destroy and Recreate

ToolboxZX

Member
Licensed User
Longtime User
Hello,
Can someone tell me the proper syntax to apply this code the to manifest editor:
android:configChanges="keyboard|keyboardHidden|navigation"

The scenero is I have a blue tooth keyboard and when I turn it off (or get out of range) the activity is destroyed then recreated. :(

I found the above configuration allows the activity to handle it.

Related source links where I obtained this information:
http://stackoverflow.com/questions/...oard-will-cause-activity-destroy-and-recreate

http://developer.android.com/guide/topics/manifest/activity-element.html#config

Thank you.
 

ToolboxZX

Member
Licensed User
Longtime User
Figured it out :) For others trying to achieve this:
SetActivityAttribute(activityname, android:configChanges,"orientation|screenSize|keyboard|keyboardHidden|navigation")

where "activityname" is your main activity, (for example: Main)
 
Upvote 0

ToolboxZX

Member
Licensed User
Longtime User
Thank you Erel! :)

When applying this method of keyboard change handling, do we have a way to monitor the Activity onConfigurationChanged method with B4A?

The android developer documentation also says:

"....declaring a configuration with this attribute will prevent the activity from being restarted. Instead, the activity remains running and its onConfigurationChanged()method is called."
 
Upvote 0
Top