The launchMode is "singleTop":
<activity android:name=".MainActivity" android:label="@string/app_name" android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".GridActivity"></activity>
The MainActivity is the splash screen, when it finish (authenticate with the server) it'll call the GridActivity.
The problem is very specific:
When you install the app from the Google Play the icon will appear in two places: Application Drawer & "Desktop" (launcher screen - default launcher).
Steps to reproduce the problem:
- Open the app from the Application Drawer and wait for the GridActivity to be displayed
- Press the "home" button to send the application to the background
- Open the app from the "Desktop" (device's default launcher)
- The application will start in a new instance
I would expect the application will go directly to the GridActivity because of the "singleTop" launchMethod.
BTW, If on step 3 I open the application again from the Application Drawer it works fine, goes directly to the GridActivity.
What am I missing?