title: Programmatically Hide an Android App in Launcher?
body: <p>I'm having trouble understanding PackageManager it seems. For this example I want to hide google talk app from the default launcher. Any help would be appreciated :)</p>
  
  <p>In my Main Activity.java</p>
  
  <pre><code>if (HideMessageButton.isChecked()) {  
               //HideMessageButton.setChecked(true);  
                  PackageManager pm = this.getPackageManager();
                  pm.setComponentEnabledSetting(new ComponentName("com.google.android.talk",
                            "com.google.android.talk.LAUNCHER"),
                          PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
                          PackageManager.DONT_KILL_APP);
  
              } else { 
  
                  HideMessageButton.setChecked(false);  
              }
           }
  </code></pre>
  
  <p>In my Manifest.xml</p>
  
  <pre><code> package="com.example.hideapp"
  &lt;activity
          android:name="com.google.android.talk"
          android:label="@string/talk" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.android.talk.MAIN" /&gt;
              &lt;category android:name="com.google.android.talk.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  </code></pre>