Questions tagged [android-task]

Android task is a collection of activities that users interact with when performing a certain job. The activities are arranged in a stack (the back stack), in the order in which each activity is opened.

Android task is a collection of activities that users interact with when performing a certain job. The activities are arranged in a stack (the back stack), in the order in which each activity is opened.

A task is a cohesive unit that can move to the "background" when users begin a new task or go to the Home screen, via the Home button. While in the background, all the activities in the task are stopped, but the back stack for the task remains intact - the task has simply lost focus while another task takes place. A task can then return to the "foreground" so users can pick up where they left off.

Useful links

124 questions
2
votes
4 answers

Launch new activity and clear previous activities except home activity

I have a sequence of activity launches below: Home Activity -> 2nd Activity -> 3rd Activity - > 4th Activity What I want to achieve is that when the 3rd activity launches the 4th activity, it clears activities 2 and 3 from the backstack. Thus,…
FlashAsh80
  • 1,357
  • 1
  • 16
  • 27
2
votes
1 answer

PendingIntent to finish current 3rd party activity as well as starting it's corresponding activity

My app passes a PendingIntent (which calls my own Activity) to a 3rd party app as well as starting an Activity in that 3rd party app. At some point, the 3rd party app starts that PendingIntent (on some button click), but it does not finish its own…
Mark
  • 7,446
  • 5
  • 55
  • 75
2
votes
2 answers

How to resume an existing task in its current state

My application has two activities A and B. A is the root of the task, and is the one that is launched from the launch icon. B can be started from A. As well as starting A from the launch icon, it is possible to launch A by clicking on a file in…
Paul Boddington
  • 37,127
  • 10
  • 65
  • 116
2
votes
4 answers

Android activities remain on stack even after OS kills application

The problem: The application allows you to open a multitude of activities. Start application normally, open several activities then close app on HOME button. Use your phone, open other applications. In some moments Android OS kills application…
2
votes
1 answer

Android create different backstacks (tasks) and return to them

I have read this article: http://developer.android.com/guide/components/tasks-and-back-stack.html If I read it correctly it says you can create a new task with a new activity while the old task still has a backstack. They are also talking about…
2
votes
1 answer

Android - How to detect the final Activity in the stack

I use the code below to check the final Fragment in an Activity to pop a dialog @Override public boolean onKeyDown(int keyCode, KeyEvent event) { // Check if there is only one fragment if (keyCode == KeyEvent.KEYCODE_BACK) { …
Devrath
  • 42,072
  • 54
  • 195
  • 297
2
votes
0 answers

Start activity of another task and stay within current task

I have an application with, let say, two activities. One of the activity is already launched and after pressing "home" button it is in background. Now, from the ANOTHER application the second activity is launched. And when this second activity is…
Ov3r1oad
  • 1,057
  • 1
  • 12
  • 25
2
votes
0 answers

How to know application is triggered from launcher icon in android?

Is there any way to differentiate the different trigger points of android application. For example, application can be triggered from notification bar/launcher icon/recent. My app contains two tasks. Once user tap on launcher icon, only main task…
Daud Arfin
  • 2,499
  • 1
  • 18
  • 37
2
votes
2 answers

Android: When resuming app after pressing home, app always starts at root Activity

My use case for a game looks so: I have a LoadingActivity, which loads (by AsyncTask, but this doesn't matter) and stores all the graphics needed for the game in a static class. After the loading finished, the MenuActivity appears. From this…
Bevor
  • 8,396
  • 15
  • 77
  • 141
1
vote
2 answers

Switching back to previous task in android

I have three activities A, B, and C. As expected when C is changed to pip (picture in picture) mode, it is separated out as a new task. When back pressed is pressed on Activity C, it will be finished and the user will be sent to the android system…
1
vote
0 answers

Why does startActivity() to Activate MDM prompt from a receiver flash the prompt and not open it?

In a small MDM (Device Manager) app, we're trying to achieve the following functionality: Have the "Activate Device Manger" dialog popup as soon as the app is installed. This app must be installed on many devices using ADB in an enterprise setting,…
1
vote
1 answer

How to force kill Picture and Picture activity on cross icon click?

i am trying to kill activity from tasks after picture and picture mode was activated and so far I tried finish(), finishAffinity(), onBackPressed(), programmatically set excludeFromRecent but activity still lives on in background.. We can see same…
1
vote
1 answer

Why Android OS does not create a new instance of an singleTop activity if my app in the background?

My app has two activities: A and B. A - is the main activity (default for launch), it has action android.intent.action.MAIN and category android.intent.category.LAUNCHER, and A activity has overridden lanchMode="singleTop", it means that if we…
1
vote
0 answers

Is there any way to keep AlarmManager in android even if task dies?

I am making an alarm app using AlarmManager. The problem is, if I kill the app on the task, AlarmManager doesn't work. How do I fix it? MainAtivity.kt fun scheduleAlarm(context: Context) { val alarmManager =…
H.JiMan
  • 269
  • 1
  • 2
  • 10
1
vote
0 answers

How can I start a new activity within a separate process without losing onActivityResult callback?

I want to start a new activity in a separate android process by defining it as android:process=":processname" inside AndroidManifest.xml. However, I need to return a response to the caller activity. So, I need to start this activity through…
1 2
3
8 9