New activity instance opened on Android 11
Thank you very much for your awesome package. In my app I have implemented this with android:launchMode="singleTask" and this worked quiet well all the time. Unfortenetly on Android 11 this doesn't work anymore. On Android 11 a new instance of the Flutter activity is opened which leads to problems.
Does anyone knows a workaround so far?
Best regards and stay healthy
I am facing the same issue. Did you find any workaround so far?
I am using Android 9 for testing and getting same issue only when sharing from some apps like Telegram It is working fine with the apps like instagram, facebook etc
make sure you add the following part correctly

@elham-rababah That looks like it might solve the issue. Would you mind giving some more background on what the code snippet does and why?
EDIT: I dug into this some more. Actually the entry in AndroidManifest.xml should be enough to make sure that only one instance of your app is launched. here is some more background on that.
The code snippet is meant to ensure that your app's activity is not launched on top of the app that the user is sharing from (to the user seemingly replacing it). According to this this SO question however, the code above is only applicable specifically when sharing from Google Chrome. In the general case, the snippet you want is:
import android.app.Activity
import android.content.Intent.FLAG_ACTIVITY_NEW_TASK
import android.os.Bundle
class ExternalTextReceiverActivity : Activity() {
val CUSTOM_EXTRA_NAME = "RELAUNCHED"
override fun onCreate(savedInstanceState: Bundle?) {
if (!intent.getBooleanExtra(CUSTOM_EXTRA_NAME, false)) {
this.finish()
intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(CUSTOM_EXTRA_NAME, true);
startActivity(intent);
}
super.onCreate(savedInstanceState);
// The rest of your onCreate code here
}
}
I have not testet this myself yet.
same problem on Android 10 also with outlook. the suggestion from elham-rababah do not work for me. Any other suggestions?