Java tutorial
//package com.java2s; import android.app.ActivityManager; public class Main { private static String getLower(ActivityManager mActivityManager) { return mActivityManager.getRunningTasks(1).get(0).topActivity.getPackageName(); } }