public void hide(View view){//this is button onClick
boolean bool;
try{
PackageManager p = getPackageManager();
p.setComponentEnabledSetting(getComponentName(), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
bool=true;
}catch (Exception e) {
e.printStackTrace();
bool=false;
}
if (bool){
Toast.makeText(getApplicationContext(),"hide",Toast.LENGTH_LONG).show();
}else {
Toast.makeText(getApplicationContext(),"Error!",Toast.LENGTH_LONG).show();
}
}
public void showw (View view){//this is button onClick

boolean bool;
try{
PackageManager p = getPackageManager();
p.setComponentEnabledSetting(getComponentName(), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
bool=true;
}catch (Exception e) {
e.printStackTrace();
bool=false;
}
if (bool){
Toast.makeText(getApplicationContext(),"showed!",Toast.LENGTH_LONG).show();
}else {
Toast.makeText(getApplicationContext(),"Error",Toast.LENGTH_LONG).show();
}

}
//if hide icon method embedded in onCreate method, when start app(open app) icon is hide!!!