2

Hi, currently I'm developing an android-launcher application using Ionic 3/Cordova. To make sure there's always only one instance at a time I'm using android:launchMode="singleInstance" ( When setting the app as homescreen while the app is already opened, which is the standard flow, the "un-launcher" instance is kept while a new instance is launched. This leads to undesirable behaviour. ) This setting is working as expected!

But at some point I need to start other activities into the task, e.g. an ImagePicker or the camera to select/upload images. No problems on Android 5.+. On 4.4 devices the activities get started correctly but the callbacks don't work anymore and return instantly. This isn't as unexpected when reading the android doc to android:launchMode="singleInstance":

Same as "singleTask", except that the system doesn't launch any other activities into the task holding the instance. The activity is always the single and only member of its task.

Strange that Android 5.+ works tho and I can't use singleTask because that way I still get a second instance of my root application when setting it as launcher.

This issue is known, but because I depend on singleInstance I couldn't find a solution to launch activities into the launcher task despite this launchMode on Android 4.4.

Frede
  • 701
  • 4
  • 14

0 Answers0