Android examples for android.app:ActivityManager
get Activity Manager
import android.app.ActivityManager; import android.app.Service; import android.content.Context; import android.os.PowerManager; public class Main{ public static ActivityManager getActivityManager(Context context) { try {/*from ww w .j av a 2 s . co m*/ return (ActivityManager) context .getSystemService(Service.ACTIVITY_SERVICE); } catch (SecurityException e) { } catch (ClassCastException e) { } return null; } }