android-task

Job Scheduler not running within set interval

廉价感情. 提交于 2019-11-30 13:12:34
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 hit. I'm not sure why this is happening. Could the Job Scheduler have a minimum interval time. My code is simply... JobInfo jobInfo = new JobInfo.Builder(1, new ComponentName(this, UpdateDatabaseService.class)) .setPeriodic(5000) .build(); JobScheduler jobScheduler = (JobScheduler) getSystemService(Context.JOB_SCHEDULER_SERVICE); jobScheduler

Show dialog activity over another app from background

家住魔仙堡 提交于 2019-11-30 09:14:32
问题 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 leaving app B's activity visible behind it). Is this possible? (The usual answer to this would be to display a notification, but this is not a mass market app, and we are trying to get the user's attention very directly.) Currently, I was trying to

How to get recent tasks on Android “L”?

好久不见. 提交于 2019-11-26 04:21:10
问题 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 documentation: If your app uses ActivityManager.getRecentTasks()... With the introduction of the new concurrent documents and activities tasks feature in the upcoming release (see Concurrent documents and activities in Recents screen below), the