1
public class Unistallreceiver extends BroadcastReceiver { 
    @Override 
    public void onReceive(Context context, Intent intent) { 
            // TODO Auto-generated method stub 
            String action = intent.getAction(); 
            if (action == null) 
                    Log.e("uninstall ", "Action==null!"); 
            else if ("android.intent.action.BOOT_COMPLETED".equals(action)) { 
                    Log.e("uninstall ", "action :"+action); 
            } 
    } 

}

Doing something like this, but can't get notification.Reference said :

public static final String ACTION_PACKAGE_REMOVED

Since: API Level 1 Broadcast Action: An existing application package has been removed from the device. The data contains the name of the package. The package that is being installed does not receive this Intent

A need this intent to set uninstall password.

Any suggestions??

sigrlami
  • 1,822
  • 1
  • 17
  • 35
  • Please see this post for your answer: [http://stackoverflow.com/questions/21756180/ask-for-password-before-uninstalling-application][1] [1]: http://stackoverflow.com/questions/21756180/ask-for-password-before-uninstalling-application – M.Rezaei Jan 20 '15 at 12:19

1 Answers1

1

Get rid of the "set uninstall password" requirement.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • CommonsWare you wrote couple great books about Android,but give so useless answer.Is there some possibilities to get admin mode, like in Google's API example, or anything else??? – sigrlami Jul 23 '10 at 09:52
  • 2
    @Zeldan: Android very explicitly prevents applications from getting control as part of the uninstall process, as a security measure, to help prevent some tricks used by malware on Windows. Hence, any feature that depends on getting control at the time of uninstall simply cannot be implemented without firmware modifications. Of course, writing your own firmware is certainly a possibility. I have no idea what an "uninstall password" is and so cannot advise you on other alternatives. – CommonsWare Jul 23 '10 at 11:41