Code example for ComponentName

Methods: equals

0
            RunningTaskInfo nextTask = tasks.get(1);
 
            // if we're looking at this application's base/launcher Activity, 
            // and the next task is the Android home screen, then we know we're 
            // about to close the app 
            if (currentTask.topActivity.equals(currentTask.baseActivity)
                    && nextTask.baseActivity.getPackageName().startsWith("com.android.launcher")) {
                DroidFuApplication application = (DroidFuApplication) context
                        .getApplicationContext();
                application.onClose();
            } 
        } 
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java