launchmode

singleTask and singleInstance not respected when using PendingIntent?

烈酒焚心 提交于 2019-12-05 12:39:45
I have an activity with launchMode set to singleTask: <activity android:name="com.blah.blah.MyActivity" android:launchMode="singleTask"> </activity> I have an ongoing notification with a PendingIntent that launches that activity: Intent activityIntent = new Intent( this, MyActivity.class ); TaskStackBuilder stackBuilder = TaskStackBuilder.create( this ); stackBuilder.addParentStack( MyActivity.class ); stackBuilder.addNextIntent( activityIntent ); PendingIntent resultingActivityPendingIntent = stackBuilder.getPendingIntent( REQUEST_CODE, PendingIntent.FLAG_UPDATE_CURRENT ); ... m

Android activity launch mode and deeplink issue

三世轮回 提交于 2019-12-05 09:21:55
My app has 2 activities. The root activity of the app is the MainActivity. If credentials are missing or invalid the user will be redirected to the LoginActivity while finishing the MainActivity. If i set the launch mode of the main activity to singleTask and I am in an inner fragment of the LoginActivity => minimize the app -> launch the app from the launcher icon => The MainActivity launches (since it is a singleTask activity) and redirects to the LoginActivity but of course to the first fragment in the stack. The wanted behavior (as is happening when re-launching from recents) is that it

SINGLE_TOP | CLEAR_TOP seem to work 95% of the time. Why the 5%?

限于喜欢 提交于 2019-12-04 23:41:11
I have a nearly-finished application with a non-trivial activity structure. There are push notifications associated with this app, and selecting the notification entry is supposed to bring up a specific activity regardless of whether the app is foreground/background/not active. If the app is not active, I have been able to successfully start the app and auto-navigate to the appropriate part. However, when the app is active, I have a problem. I will present a simplified version of the issue, to communicate the nature of the problem, and I will post the details of my app's activity structure and

Android task and process, SingleTask and SingleInstance

試著忘記壹切 提交于 2019-12-04 11:00:52
问题 I have read through Google Android Developer page, but the concept of task (http://developer.android.com/guide/components/tasks-and-back-stack.html) really confuse me. After I read until SingleTask and SingleInstance, I am getting more confused. I would like to ask some question by using examples, hope that I will have better understanding from these question: Let's say I have 2 applications A and B, A has x, y, z activities; B has 1, 2, 3 activities: Assume that their launch mode are

android 4.4.X: taskAffinity & launchmode vs. Activity lifecycle

怎甘沉沦 提交于 2019-12-04 10:46:07
问题 I developed a simple application, which demostrates some strange behaviour on Android 4.4.X devices I noticed. Lets say I want to have 2 "main" activities, where the first says "Hello" (by starting 'HelloActivity') every second time it is resumed and the second one has android:launchMode="singleTask" android:taskAffinity=".MyAffinity" defined. Second one is started by the first one. My Code Manifest is pretty simple: <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="14" />

Android task and process, SingleTask and SingleInstance

不问归期 提交于 2019-12-03 06:53:06
I have read through Google Android Developer page, but the concept of task ( http://developer.android.com/guide/components/tasks-and-back-stack.html ) really confuse me. After I read until SingleTask and SingleInstance, I am getting more confused. I would like to ask some question by using examples, hope that I will have better understanding from these question: Let's say I have 2 applications A and B, A has x, y, z activities; B has 1, 2, 3 activities: Assume that their launch mode are Standard (Not using any intent flag). And x is Main Activity of app A; 1 is Main Activity of app B. 1)

android 4.4.X: taskAffinity & launchmode vs. Activity lifecycle

被刻印的时光 ゝ 提交于 2019-12-03 06:26:45
I developed a simple application, which demostrates some strange behaviour on Android 4.4.X devices I noticed. Lets say I want to have 2 "main" activities, where the first says "Hello" (by starting 'HelloActivity') every second time it is resumed and the second one has android:launchMode="singleTask" android:taskAffinity=".MyAffinity" defined. Second one is started by the first one. My Code Manifest is pretty simple: <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="14" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style

Single Instance : Launch Mode of Launcher Activity

主宰稳场 提交于 2019-11-30 16:02:53
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.jatin.notification"> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity" android:launchMode="singleInstance" > <!-- Activity A --> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent

Why Behaviours are different ?- android:launchMode=“singleTask” , android:taskAffinity=“” And Intent.FLAG_ACTIVITY_NEW_TASK

[亡魂溺海] 提交于 2019-11-30 15:14:52
I have Four Activity - A,B,C,D I am calling these four activity in manner --> A-B-C-D-B. (Specified Manner) I have three scenario. 1st :- I am defining android:launchMode="singleTask" only in B Activity. And I am calling all activity via Intent in above specified manner. Now First calling A-B-C-D , BackStack Task 1 : A-B-C-D, Now I again call B, Then BackStack Task 1 : A-B . Here C and D Activities are destroyed. 2nd :- I am defining android:launchMode="singleTask" & android:taskAffinity="" in B Activity. And I am calling all activity via Intent in above specified manner. Now First calling A-B

How should I define launchMode in AndroidManifest.xml - Using PhoneGap & JQM

放肆的年华 提交于 2019-11-30 04:55:40
I am struggling to restrict my application to a single instance. Currently if the user presses home screen to quit the application, then does something outside and clicks on the application's icon again, it launches the App's second instance. Here is my complete manifest file: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.mydomain.qfa" android:versionCode="4" android:versionName="1.3"> <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="13" android:maxSdkVersion="18" /> <uses-permission android:name="android