ekke/ekkesSHAREexample

Sharing problem on android when running in background

dorianim opened this issue · 5 comments

Hi @ekke
First, thanks for your work, it helped me a lot :D
I have a strange problem on Android though, where the app freezes in this view:
image
Whenever I share a file and the App is already running. Everything works fine again, when I close the app.
I am running on Android 10 using Qt 5.15.2.

ekke commented

I'm just in the progress to move my projects from 5.13.2 to 5.15
will take a week or so to finish
then I'll take a look at your problem

ekke commented

have done my housework and updated app for Qt 5.15

opened app
send in background
goto photos, share a photo and my app comes displaying the photo
tested on Android 9 device, Android 10 device, Qt 5.15.5, QtC 5.14.1

Cool, I'll test it later this week :D

Cool, I'll test it later this week :D

Ok, I tested it, and was able to solve the issue :D
The problem was that I used android:launchMode="singleTop"(probably the default) instead of android:launchMode="singleInstance"
over here:

<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="org.ekkescorner.examples.sharex.QShareActivity" android:label="ekkes SHARE Example" android:screenOrientation="unspecified" android:launchMode="singleInstance">

Thank you very much!