我想在android上做一个应用程序。从那里我可以使用密码锁定其他已安装的应用程序。有什么办法吗?请在编码功能方面帮助我..我可以通过以下代码读取所有已安装的应用程序。但我需要知道如何锁定其他应用程序?
PackageManager pm = getPackageManager();
List<ApplicationInfo> apps = pm.getInstalledApplications(0);
List<ApplicationInfo> installedApps = new ArrayList<ApplicationInfo>();
for(ApplicationInfo app : apps) {
ApplicationInfo aa = app;
//checks for flags; if flagged, check if updated system app
if((app.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) == 1) {
installedApps.add(app);
Log.v("__________________",""+aa.processName.toString());
//it's a system app, not interested
} else if ((app.flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
//Discard this one
//in this case, it should be a user-installed app
installedApps.add(app);
Log.v("__________________",""+aa.processName.toString());
} else {
installedApps.add(app);
}
}发布于 2012-02-20 00:12:20
好的--这是我的建议--你需要更换launcher应用程序(请看这里:https://groups.google.com/forum/?fromgroups#!topic/android-developers/vBv6RA2iPiI获取相关讨论)。
这样,您就可以包含或排除您选择的图标。
https://stackoverflow.com/questions/9331934
复制相似问题