Here you can find the source of enableComponent(PackageManager pm, ComponentName component)
public static void enableComponent(PackageManager pm, ComponentName component)
//package com.java2s; import android.content.ComponentName; import android.content.pm.PackageManager; public class Main { public static void enableComponent(PackageManager pm, ComponentName component) {//from w w w . j a v a 2 s .c o m pm.setComponentEnabledSetting(component, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); } }