Reputation: 1581
I've encountered a weird behaviour. Maybe someone could clarify it. When I download my app from GooglePlay, there are 2 icons that are added. One goes to the Home Screen as a shortcut and another goes to the App Drawer (the screen with all the different installed apps I got on my device).
Now here is the flow of events:
Now the interesting part:
This happens constantly. Each shortcut launches to a different state (or screen). Notice that there is only one app in the Recent list.
On a the other hand. If I create the Home Screen shortcut myself, I get the same results when I launch the app from both icons. Something is different with the shortcut GooglePlay is creating for me.
Any ideas?
EDIT Here is the AndroidManifest.xml Some names where changed. Some information (that is not related to intent-filters) had to be removed..
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.xxxx.xxxxjh"
android:installLocation="internalOnly">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
tools:node="replace"
android:name=".xxxxgggApplication"
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:largeHeap="true"
android:hardwareAccelerated="true"
android:theme="@style/AppTheme" >
<activity
android:name=".view.activities.StartupActivity"
android:theme="@style/AppThemeNoBar"
android:windojhoftInputMode="adjustResize|stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".view.activities.WelcomeActivity"
android:theme="@style/WelcomeActivityStyle"/>
<activity
android:name=".view.activities.AccountActivity"
android:theme="@style/AppThemeNoBar"
android:windojhoftInputMode="adjustResize|stateHidden"/>
<activity
android:name=".view.activities.UrlSchemeHandlerActivity"
android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="xxxx" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="xxxx5.4" />
</intent-filter>
</activity>
<activity
android:name=".view.activities.FileManagerActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
android:logo="@drawable/fm_drawer"
android:theme="@style/AppThemeBar"
android:windojhoftInputMode="adjustPan|stateHidden"/>
<activity
android:name=".view.activities.ViewerActivity"
android:label="@string/launcher_activity_label"
android:theme="@style/AppThemeNoBar"
android:windojhoftInputMode="adjustResize|stateHidden"
android:parentActivityName=".view.activities.FileManagerActivity" >
<!-- The meta-data element is needed for versions lower than 4.1 -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".view.activities.FileManagerActivity" />
</activity>
<activity
android:name=".view.activities.DemoActivity"
android:label="@string/launcher_activity_label"
android:theme="@style/WelcomeActivityStyle"
android:windojhoftInputMode="adjustResize|stateHidden" />
<activity
android:name=".view.activities.ApplicationSettingsActivity"
android:logo="@drawable/fm_drawer"
android:label="@string/AG_Settings"
android:windojhoftInputMode="adjustResize|stateHidden">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xxxx.xxxxjh.view.activities.FileManagerActivity" />
</activity>
<activity
android:name=".view.activities.WebViewActivity"
android:logo="@drawable/fm_drawer"
android:theme="@style/AppThemeBar" />
<service android:name="com.xxxx.sdk.controller.service.account.AccountService" >
<!-- Actions and meta data goes here... -->
</service>
<service android:name="com.xxxx.sdk.controller.service.storage.StorageService">
<!-- Actions and meta data goes here... -->
</service>
<service android:name="com.xxxx.sdk.controller.service.designFeed.DesignFeedService">
<!-- Actions and meta data goes here... -->
</service>
<service android:name="com.xxxx.sdk.controller.service.ConfigService">
<!-- Actions and meta data goes here... -->
</service>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
</application>
Upvotes: 0
Views: 1518
Reputation: 539
I am sorry to tell you that this is not a bug in your project but an android default behaviour. I did some research ending up in the following threads. Maybe you can filter out some useful information and test these approaches in your project.
App completely restarting when launched by icon press in launcher
Android application restarts when opened by clicking the application icon
Greetz.
Upvotes: 1