android 判断快捷方式问题
在android应用启动时中我写了个判断快捷方式的方法,但是它总是返回false,并不会返回true,请问下我哪里写错了吗?
谢谢各位了!
代码如下:
private boolean isFavorites() { boolean isInstallShortcut = false; final ContentResolver cr = 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[] { getString(R.string.app_name) }, null); if (c != null && c.getCount() > 0) isInstallShortcut = true; return isInstallShortcut; }