Hi all,
I'm having some issues with Android destroying and then re-creating the activity.
I've been able to re-produce this issue when connecting a bluetooth barcode scanner when the activity is open. As soon as the bluetooth device connects, the activity is shut down and re-created. My dynamically generated controls (not made in designer) are therefore losing their values when the layout is re-built.
I've read somewhere that the configuration state changes are detected by Android and so it restarts the activity to apply the new changes.
I have added the following to the manifest file, but it has is no effect:
I think I may have done that wrong. I am testing this by re-orientation (which I think should be dealt with by the above manifest code). The activity is still being re-created when re-orientating the screen.
Does anyone have any suggestions as to how to deal with this? Either by blocking the activity from being re-created or by preserving the value of my dynamic controls when it happens. I don't really mind.
Thanks in advance
I'm having some issues with Android destroying and then re-creating the activity.
I've been able to re-produce this issue when connecting a bluetooth barcode scanner when the activity is open. As soon as the bluetooth device connects, the activity is shut down and re-created. My dynamically generated controls (not made in designer) are therefore losing their values when the layout is re-built.
I've read somewhere that the configuration state changes are detected by Android and so it restarts the activity to apply the new changes.
I have added the following to the manifest file, but it has is no effect:
B4X:
AddApplicationText(<activity android:name=".FilesAndScanning"
android:configChanges="orientation|keyboard|locale|mcc|mnc|uiMode|screenSize"/>)
I think I may have done that wrong. I am testing this by re-orientation (which I think should be dealt with by the above manifest code). The activity is still being re-created when re-orientating the screen.
Does anyone have any suggestions as to how to deal with this? Either by blocking the activity from being re-created or by preserving the value of my dynamic controls when it happens. I don't really mind.
Thanks in advance