读书人

android 判断快捷方式有关问题

发布时间: 2012-04-23 13:17:38 作者: rapoo

android 判断快捷方式问题
在android应用启动时中我写了个判断快捷方式的方法,但是它总是返回false,并不会返回true,请问下我哪里写错了吗?
谢谢各位了!
代码如下:

Java code
    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;    }


[解决办法]
可能是中文名称导致的没找到
[解决办法]
这个是安全的考虑,如果用户不同意就不创建,系统默认的设置,不是那么容易改的!

读书人网 >Android

热点推荐