public static Set<String> getAllHostPackages(Context ctx)
{
SharedPreferences prefs = ctx.getSharedPreferences("KP2A.PluginAccess.hosts", Context.MODE_PRIVATE);
Set<String> result = new HashSet<String>();
for (String host: prefs.getAll().keySet())
{
try
{
PackageInfo info = ctx.getPackageManager().getPackageInfo(host, PackageManager.GET_META_DATA);
//if we get here, the package is still there
result.add(host);
}
catch (PackageManager.NameNotFoundException e)
{
//host gone. ignore.
}
}
return result;
}
AccessManager.java 文件源码
java
阅读 35
收藏 0
点赞 0
评论 0
项目:keepass2android
作者:
评论列表
文章目录