首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

android 判断快捷方式有关问题

2012-04-23 
android 判断快捷方式问题在android应用启动时中我写了个判断快捷方式的方法,但是它总是返回false,并不会

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


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

热点排行