Android examples for App:Package
get Running package
//package com.java2s; import android.app.ActivityManager; import android.content.Context; public class Main { public static String getRunningPkg(Context con) { ActivityManager am = (ActivityManager) con .getSystemService(Context.ACTIVITY_SERVICE); return am.getRunningTasks(1).get(0).topActivity.getPackageName(); }/*from ww w . j a v a 2 s. com*/ }