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
1
vote
1 answer

Issue with taskAffinity and excludeFromRecents on Android 10

I have an application which is sometimes displaying notifications to users. When pressing a notification, a "Dispatch" Activity is triggered which calls startActivities with some intents leading to proper activity depending on the notification…
1
vote
0 answers

How to make FLAG_ACTIVITY_NEW_TASK ignore taskAffinity?

I have a problem with two of the buttons in a launcher app I'm developing. The first button should launch TotalCommander's built-in text editor to display a certain text file. The second button should launch TotalCommander. So I started with the…
Tamás Bolvári
  • 2,976
  • 6
  • 34
  • 57
1
vote
1 answer

Hide / Unhide application when connect / disconnect USB BroadcastReceiver

My application only have MainActivity with a ImageView. BroadcastReceiver works. The Toast Message is displayed When I connect USB. Now, I need start my application minimized and show the application only the USB cable was…
1
vote
0 answers

Back navigation from an Activity which had FLAG_ACTIVITY_NEW_TASK to an Activity which had FLAG_ACTIVITY_NEW_DOCUMENT is not working

I've got a strange issue while working with intent flags. I will try to explain as clear as possible. I have 3 Activities in my app. Dashboard Activity, Document Activity, and Child Activity. I've started Dashboard Activity with default intent…
Vijay
  • 545
  • 1
  • 5
  • 15
1
vote
0 answers

Returning to app with back button after chooser launched

Given this: fun sendEmailAction(context: Context?, subject: String, body: String, emailAddress: String) { val emailIntent = Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", emailAddress, null)) emailIntent.putExtra(Intent.EXTRA_SUBJECT,…
MPelletier
  • 16,256
  • 15
  • 86
  • 137
1
vote
0 answers

How can an activity with 'singleTask' be anything but the root of a task's back-stack?

Reading Google's own documentation here, they state starting an activity with the 'singleTask' launch mode will either start a new task with that activity as its root, or, if there already is a task with that activity in it, that entire task's stack…
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
1
vote
0 answers

Firebase Tasks whenAll not working as expected, skipping OnCompleteListener

This is the flow of my program: I can create a learning session where in this session, user can stream video, and/or download attached file(s), and/or answering question in multiple choice format. So in one session, it can contains a video and/or…
1
vote
0 answers

Intent receiving in deep-linked-activity

I have some problems with proper task stack and bringing to front during deep-linking implementations... I have an Activity declared like this:
snachmsm
  • 17,866
  • 3
  • 32
  • 74
1
vote
1 answer

Activity with launchMode singleTop or singleTask is always recreated

The MainActivity in my app has a launchMode of singleTop defined in the manifest file. Whenever I click a notification my MainActivity is re-created and the old instance is destroyed. MainActivity is visible and in the foreground when the…
1
vote
3 answers

Android - Go back to MainActivity after restarting task from recents

I have MainActivity in which I can launch camera application to take and upload photo. After home long press while in camera app and returning back from recents I return to camera application. How can I ALWAYS return to MainActivity from recents or…
1
vote
0 answers

Gcm network manager periodic tasks

I have a task where it reads data from server every 10 seconds. I gave a try to gcm network manager where I created a periodic task and set the interval to 10L. But the task is not firing in every 10 seconds. The minimum time for successive firing…
Krishna
  • 11
  • 6
1
vote
1 answer

An android:nohistory flag being ignored

Here's the scenario: User uses Activity#1 to schedule an alarm (using the the android AlarmManager service), and goes back to home screen. Activity#1 remains in stack. AlarmReciever's onReceived() is called as planned: @Override public void…
1
vote
0 answers

appContext.startActivity - Is it a good idea?

I been told that starting activity from application context is bad idea, and you should prefer using activity context where possible. Intent intent = new Intent(appContext, MyActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); …
Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
1
vote
1 answer

Android Activity Incorrectly Re-parenting to Application Task

I have an application which has the usual task behaviour for most activities, but it also has one activity that needs to be launched onto the task that created it. This activity is launched from a mime type. If another application launches the…
1
vote
0 answers

Showing list of recent apps - getRecentTasks, AccessibilityService or UsageStatsManager

What approach should I prefer? I want my solution to work on android 4.2 upwards, also in L and M. getRecentTasks - won't work in android L anymore... AccessibilityService - I monitor the active apps myself and so I can show a list of recent apps,…
prom85
  • 16,896
  • 17
  • 122
  • 242
1 2 3
8 9