Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter App opens in another application(duplicate application)

I'm using app links with uni_links library in my flutter app.

There is a problem that whenever I clicked my app link in another application(like Google Calendar), the OS opens my app again.

Somehow I have a duplicate of that. Here is my screenshot that what exactly happened:

my screenshot

I just want to open my last app that exists in background.

What should I do to fix this problem?

like image 820
Aref Avatar asked Oct 28 '19 18:10

Aref


People also ask

Can any one tell me how do you open another app using flutter?

You can use flutter_appavailability package. This plugin allows you to check if an app is installed in mobile and using this plugin you can launch an app. If already installed then launch otherwise open link in WebView using url_launcher.

How do you open the Flutter app from another flutter app?

For opening apps in android For opening an external app from your app in android, you need provide packageName of the app. If the plugin finds the app in the device, it will be be launched. But if the the app is not installed in the device then it leads the user to playstore link of the app.

Can I hide flutter app contents when the app is in background?

Yes, and I override the didChangeAppLifecycleState method. And in that you cleared the state or navigated to another screen? Well, now I know that you are not the only one facing this issue. And the android docs say that for this functionality resort to native code as much as possible.


1 Answers

Well according to this answer,

I should change android:launchMode="singleTop" to android:launchMode="singleTask" of my MainActivity in manifest.xml.

like image 106
Aref Avatar answered Oct 03 '22 07:10

Aref