Java tutorial
//package com.java2s; import android.content.ComponentName; import android.content.Context; import android.content.pm.PackageManager; public class Main { public static boolean isEnabled(Context context, Class<?> clazz) { ComponentName componentName = new ComponentName(context, clazz); PackageManager pm = context.getPackageManager(); return pm.getComponentEnabledSetting(componentName) != PackageManager.COMPONENT_ENABLED_STATE_DISABLED; } }