问题
I want to block/unblock (where user can not use/access the blocked application) some application in an android device from my application. But I couldn't find any solution/ idea about this.
I read Android how to programmatically hide launcher icon, but this hide the application launcher icon of same application.
How can I do this? Please share some idea/links about this.
回答1:
If Android OS on the phone is not rooted you won't be able to block another application. Os doesn't give rights to do that. Android runs on Linux, Linux provides sandbox system call API and dictates rules.
http://developer.android.com/guide/topics/security/permissions.html
Basically you can do what is allowed to do. Intercept call's, block camera via device admin manager, read data of another apps if they share that data and only what they share, use some common resources, but not more than that. To do what you want to do your app has to be a root, but standard third party apps don't get root privileges. Your solution can be to change firmware, bind your app into it with root privileges.
回答2:
Start a Service Using Alarm Manager on every second Inside Service You have an array of Installed app and now you detect Top most App is running Top Task match with your array of application than you launch your Protector
I have Done already
来源:https://stackoverflow.com/questions/11453814/block-unblock-an-application-from-my-application-android