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
26
votes
4 answers

How to get recent tasks on Android "L"?

Background My app allows to sort an apps list by the time they were recently launched . The problem As of Android "L" , the function getRecentTasks will just return the list of apps that the current app has launched, as written in the…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
17
votes
2 answers

What happens when you click on an application's launch icon?

 What happens when you click on an app's launch icon? Is a new intent always sent, or is the result sometimes the same as resuming a task from recent tasks? If an intent is sent, when does it get sent to the onCreate() method of a new activity…
Paul Boddington
  • 37,127
  • 10
  • 65
  • 116
13
votes
2 answers

What is the difference between android:launchMode and android:documentLaunchMode attribute?

So I have been reading the docs on Tasks, Back Stack and Overview Screen and there is one thing that immensely confuses me. After having read launchMode here: http://developer.android.com/guide/components/tasks-and-back-stack.html then about…
Manish Kumar Sharma
  • 12,982
  • 9
  • 58
  • 105
13
votes
6 answers

Job Scheduler not running within set interval

I'm trying to use the android Job Scheduler API and all I'm trying to do is have the Job Scheduler run every 5 seconds. However when I run it, the corresponding service is hit every two minutes. I have a log that documents every time the service is…
Papajohn000
  • 809
  • 1
  • 16
  • 32
10
votes
5 answers

How to preserve current back stack (or task) when notification is clicked?

In my application, I create a notification which starts Details Activity. I want to add this activity to top of current task (or back stack). For example I expect application task (back stack) to behave like this: but I get this: I have not used…
h.nodehi
  • 1,036
  • 1
  • 17
  • 32
9
votes
1 answer

What makes a singleTask activity have 2 instances?

As per the docs, singleTask activities can't have multiple instances. The only activity of my app is singleTask, and it has 2 instances at the same time. Steps to recreate the issue Step 1 Create a new project in Android Studio 3.3.1, Add No…
Tamás Bolvári
  • 2,976
  • 6
  • 34
  • 57
9
votes
4 answers

Android App, Activity State (Running, Not Running, Foreground/ Background)

I have come across a requirement but I am not able to get the correct way of implementation and hence need your help. What I want to do? - I want to perform an action depending upon notification I get as follows: When app is open and in foreground…
Atul O Holic
  • 6,692
  • 4
  • 39
  • 74
8
votes
2 answers

launchMode="singleTask" does not create a new task

I have 2 activities: Activity A and Activity B. Activity A's launch mode is standard, and Activity B's launch mode is singleTask.
yrazlik
  • 10,411
  • 33
  • 99
  • 165
7
votes
3 answers

Show dialog activity over another app from background

Say you have an app A which opens up another app B (e.g. a map), which is not controlled by you (i.e. it's a preexisting app). So now app A is in the background. Suppose an event occurs and A wants to show a floating dialog over app B's UI (while…
Chris Middleton
  • 5,654
  • 5
  • 31
  • 68
7
votes
1 answer

android singleTask activity not as the root?

I've been reading doc regarding to launch modes and there is one thing I don't understard. The doc says that singleTask activity is always the root of the stack: In contrast, "singleTask" and "singleInstance" activities can only begin a task.…
Tomask
  • 2,344
  • 3
  • 27
  • 37
6
votes
0 answers

Android: Home launcher activity is recreated into new task only the first time when pressing HOME

I want to prevent user from leaving my app. I am trying to achieve this through home launcher activity/application and I don't understand android's behaviour. Pressing HOME first time always creates new activity in new task instead of moving the…
5
votes
2 answers

Is there a fix for task hijacking on Android <10?

I was reading this article about task hijacking on Android: https://blog.dixitaditya.com/android-task-hijacking/ I tried the recommend fix but can still reproduce the issue. I also tried specifying package names of Instagram, Gmail app as…
4
votes
0 answers

Android windowIsTranslucent locks orientation to portrait

I have an activity which i would like launched using: true I do not understand why on handset devices the orientation is locked to portrait and on tablet it is not. When i remove this flag the…
JY2k
  • 2,879
  • 1
  • 31
  • 60
3
votes
0 answers

Android backstack with tasks and activities from different apps

I seem to find conflicting information with regards to the basic/default behavior of the backstack when dealing with tasks whose activities come from different apps. From my understanding so far: A task is a collection of activities where those…
3
votes
1 answer

Firebase Authentication: how to verify user still exists

I am using Firebase Anonymous Authentication. In case a user has been deleted from the Firebase console, the client still believes the user exists, as it still holds the token. Each time I start the app, I would like to verify if the user still…
Daniele B
  • 19,801
  • 29
  • 115
  • 173
1
2 3
8 9