hi,
   I'm trying to remove activity icon from launcher panel. I'm using
firmware 1.5. But nothing seems to work. I'm not receiving any error but
activity icon is not removed. Following is the code


public class HelloActivity extends Activity {

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       setContentView(R.layout.hello_activity);
}


    public void onDestroy() {
        super.onDestroy();
        disbaleActivity();
}

    private void disbaleActivity(){
        ComponentName receiver = new
ComponentName(getApplicationContext(),
        "HelloActivity.class");
        PackageManager pm = getPackageManager();
        pm.setComponentEnabledSetting(receiver,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
                    PackageManager.DONT_KILL_APP);

    }
}


I've set following permission in manifest file
<uses-permission
android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />

and following is portion of activity in manifest file

      <activity android:name="HelloActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>


Please help me to resolve the issue. According to documentation it should
work but it doesn't. I've tried calling disbaleActivity() even from
OnCreate() method but no success :-(

Regards,
shaz

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to