public boolean checkShortcut()
{
boolean isInstallShortcut = false ;
final ContentResolver cr =this.getContentResolver();
final String AUTHORITY = "com.android.launcher.settings";
final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/favorites?notify=true");
Cursor c = cr.query(CONTENT_URI,new String[] {"title","iconResource" },"title=?",
new String[] {"ARecorder" }, null);//Arecorder表示应用名称,在这里检查应用程序名称
if(c!=null && c.getCount()>0){
isInstallShortcut = true ;
}
return isInstallShortcut ;
}
要有权限:
本文将介绍如何通过代码检查Android设备上应用快捷方式的安装状态,并返回一个布尔值指示是否已安装。
890

被折叠的 条评论
为什么被折叠?



