package com.whd.wifikeyview.preferences.fragments;

import com.whd.wifikeyview.R;

import android.os.Bundle;
import android.preference.PreferenceFragment;

public class DebugPreferences extends PreferenceFragment {
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		addPreferencesFromResource(R.xml.preferences_debug);
	}
}
@@ -76,16 +76,213 @@
 iew.R;%0A%0A
+import android.content.ComponentName;%0Aimport android.content.SharedPreferences;%0Aimport android.content.SharedPreferences.OnSharedPreferenceChangeListener;%0Aimport android.content.pm.PackageManager;%0A
 import a
@@ -403,16 +403,60 @@
 ragment 
+implements OnSharedPreferenceChangeListener 
 %7B%0A%09%0A%09@Ov
@@ -609,12 +609,877 @@
 debug);%0A
+%09%09%0A%09%09getPreferenceManager()%0A%09%09%09.getSharedPreferences()%0A%09%09%09.registerOnSharedPreferenceChangeListener(this);%0A%09%7D%0A%0A%09@Override%0A%09public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) %7B%0A%09%09if (key.equals(%22hide_launcher_icon%22)) %7B%0A%09%09%09int newState = (sharedPreferences.getBoolean(key, false)) ? %0A%09%09%09%09%09PackageManager.COMPONENT_ENABLED_STATE_DISABLED : %0A%09%09%09%09%09%09PackageManager.COMPONENT_ENABLED_STATE_ENABLED;%0A%09%09%09%0A%09%09%09PackageManager packageManager = %0A%09%09%09%09%09getActivity().getPackageManager();%0A%09%09%09ComponentName componentName = %0A%09%09%09%09%09new ComponentName(getActivity(), %22com.whd.wifikeyview.preferences.SettingsActivity-Alias%22);%0A%09%09%09%0A%09%09%09int oldState = packageManager.getComponentEnabledSetting(componentName);%0A%09%09%09%0A%09%09%09if (newState != oldState) %7B%0A%09%09%09%09packageManager.setComponentEnabledSetting(componentName, newState, PackageManager.DONT_KILL_APP);%0A%09%09%09%7D%0A%09%09%7D%0A
 %09%7D%0A%7D

Implement hide/unhide from launcher