I am developing one application that can be run from several places, for example, for example. hyperlink on the calendar. I ran into a problem in the scenario below: If the application is already running and running in the background and the user clicks on an event / hyperlink in their own calendar to start the application. My application launches twice as a new instance. In the list of running applications, I see two instances of my application. I tried android: launchMode = "singleInstance" and "singleInstance" for my main activity. But still does not work. Can someone suggest me a solution?
My manifest is as follows:
<application android:allowBackup="true" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.org.ManishApp" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:launchMode="singleInstance"> <intent-filter>`enter code here` <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter>
source share