Code example for ComponentName

Methods: setComponentEnabledSetting

0
        setReceiverState(PackageManager.COMPONENT_ENABLED_STATE_DISABLED);
    } 
 
    private void setReceiverState(int receiverState) {
        if (USE_COMPONENT_ENABLED_SETTING) {
            getPackageManager().setComponentEnabledSetting(new ComponentName(this, ConnectivityReceiver.class), receiverState, PackageManager.DONT_KILL_APP);
        } 
    } 
 
    public void setHostname(String hostname) {
        hostPinger.setHostAddress(hostname);
    } 
 
    public void setBindStatusListener(BindListener bindListener) {
        callbackCurrentStatus(bindListener);
    } 
 
    private void callbackCurrentStatus(BindListener bindListener) {
        if (bindListener != null) {
            if (networkStatus == null) {
                bindListener.onMerlinBind(currentNetworkStatusFetcher.getWithoutPing(this));