Search in sources :

Example 6 with AppTask

use of android.app.ActivityManager.AppTask in project android_packages_apps_Settings by LineageOS.

the class ChooseLockGenericTest method finishAllAppTasks.

private void finishAllAppTasks() {
    final ActivityManager activityManager = getTargetContext().getSystemService(ActivityManager.class);
    final List<AppTask> appTasks = activityManager.getAppTasks();
    for (ActivityManager.AppTask task : appTasks) {
        task.finishAndRemoveTask();
    }
}
Also used : AppTask(android.app.ActivityManager.AppTask) AppTask(android.app.ActivityManager.AppTask) ActivityManager(android.app.ActivityManager)

Example 7 with AppTask

use of android.app.ActivityManager.AppTask in project android_packages_apps_Settings by omnirom.

the class ChooseLockGenericTest method finishAllAppTasks.

private void finishAllAppTasks() {
    final ActivityManager activityManager = getTargetContext().getSystemService(ActivityManager.class);
    final List<AppTask> appTasks = activityManager.getAppTasks();
    for (ActivityManager.AppTask task : appTasks) {
        task.finishAndRemoveTask();
    }
}
Also used : AppTask(android.app.ActivityManager.AppTask) AppTask(android.app.ActivityManager.AppTask) ActivityManager(android.app.ActivityManager)

Example 8 with AppTask

use of android.app.ActivityManager.AppTask in project android_packages_apps_Settings by SudaMod.

the class ChooseLockGenericTest method finishAllAppTasks.

private void finishAllAppTasks() {
    final ActivityManager activityManager = getTargetContext().getSystemService(ActivityManager.class);
    final List<AppTask> appTasks = activityManager.getAppTasks();
    for (ActivityManager.AppTask task : appTasks) {
        task.finishAndRemoveTask();
    }
}
Also used : AppTask(android.app.ActivityManager.AppTask) AppTask(android.app.ActivityManager.AppTask) ActivityManager(android.app.ActivityManager)

Example 9 with AppTask

use of android.app.ActivityManager.AppTask in project android_packages_apps_Settings by crdroidandroid.

the class ChooseLockGenericTest method finishAllAppTasks.

private void finishAllAppTasks() {
    final ActivityManager activityManager = getTargetContext().getSystemService(ActivityManager.class);
    final List<AppTask> appTasks = activityManager.getAppTasks();
    for (ActivityManager.AppTask task : appTasks) {
        task.finishAndRemoveTask();
    }
}
Also used : AppTask(android.app.ActivityManager.AppTask) AppTask(android.app.ActivityManager.AppTask) ActivityManager(android.app.ActivityManager)

Example 10 with AppTask

use of android.app.ActivityManager.AppTask in project robolectric by robolectric.

the class ShadowAppTaskTest method startActivity.

@Test
public void startActivity() {
    final AppTask appTask = ShadowAppTask.newInstance();
    final Activity activity = Robolectric.setupActivity(Activity.class);
    final Intent intent = new Intent(Intent.ACTION_VIEW);
    appTask.startActivity(activity, intent, null);
    assertThat(shadowOf(activity).peekNextStartedActivity()).isNotNull();
    assertThat(shadowOf(activity).peekNextStartedActivity().getAction()).isEqualTo(Intent.ACTION_VIEW);
}
Also used : AppTask(android.app.ActivityManager.AppTask) Activity(android.app.Activity) Intent(android.content.Intent) Test(org.junit.Test)

Aggregations

AppTask (android.app.ActivityManager.AppTask)22 ActivityManager (android.app.ActivityManager)11 Intent (android.content.Intent)7 Test (org.junit.Test)6 Uri (android.net.Uri)5 Nullable (android.support.annotation.Nullable)5 TargetApi (android.annotation.TargetApi)3 RecentTaskInfo (android.app.ActivityManager.RecentTaskInfo)2 Context (android.content.Context)2 Activity (android.app.Activity)1 PackageManager (android.content.pm.PackageManager)1 HashSet (java.util.HashSet)1 Config (org.robolectric.annotation.Config)1