Here you can find the source of disableComponent(PackageManager pm, ComponentName component)
public static void disableComponent(PackageManager pm, ComponentName component)
//package com.java2s; import android.content.ComponentName; import android.content.pm.PackageManager; public class Main { public static void disableComponent(PackageManager pm, ComponentName component) {//w w w . j av a2 s . c o m pm.setComponentEnabledSetting(component, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); } }