Example usage for android.app Activity getTaskId

List of usage examples for android.app Activity getTaskId

Introduction

In this page you can find the example usage for android.app Activity getTaskId.

Prototype

public int getTaskId() 

Source Link

Document

Return the identifier of the task this activity is in.

Usage

From source file:Main.java

public static void blockRecentApps(Activity activity) {
    ActivityManager activityManager = (ActivityManager) activity.getApplicationContext()
            .getSystemService(Context.ACTIVITY_SERVICE);
    activityManager.moveTaskToFront(activity.getTaskId(), 0);
}

From source file:Main.java

public static void disableRecentAppsClick(Activity activity) {
    ActivityManager activityManager = (ActivityManager) activity.getApplicationContext()
            .getSystemService(Context.ACTIVITY_SERVICE);
    activityManager.moveTaskToFront(activity.getTaskId(), 0);
}