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

120 questions
25
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
  • 106,412
  • 122
  • 641
  • 1,128
15
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
  • 35,031
  • 9
  • 56
  • 107
12
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
  • 679
  • 1
  • 13
  • 32
9
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
  • 856
  • 1
  • 12
  • 26
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,216
  • 4
  • 36
  • 72
8
votes
0 answers

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,530
  • 3
  • 28
  • 49
7
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
  • 9,023
  • 26
  • 84
  • 145
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…
6
votes
4 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
  • 11,112
  • 7
  • 50
  • 86
5
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
  • 4,734
  • 1
  • 25
  • 54
4
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
  • 1,968
  • 1
  • 22
  • 34
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,749
  • 1
  • 26
  • 49
3
votes
0 answers

GcmTaskService and threading

Does onRunTask run on a different thread? This is not clearly explained in the documentation here https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmTaskService. Or Is there other documentation I should look at? The…
Don Box
  • 2,656
  • 17
  • 37
3
votes
3 answers

Lollipop: Get top activity name

How to get top activity name in Lollipop? ((ActivityManager)getSystemService(Context.ACTIVITY_SERVICE)). getRunningTasks(1).get(0).topActivity is not longer available for Lollipop: * @deprecated As of {@link…
VKDev
  • 584
  • 5
  • 16
3
votes
0 answers

How to run Python3 commands in Android Studio?

I have a custom gradle task (Exec type) which is responsible for running Python3 command and this task happens before the buildProcess. When i manually fire assembleDebug command via terminal, task works find and there a successful build. But when I…
1
2 3 4 5 6 7 8