直接上代码:
String url = ""; if (android.os.Build.VERSION.SDK_INT < 8) { url = "content://com.android.launcher.settings/favorites?notify=true"; } else { url = "content://com.android.launcher2.settings/favorites?notify=true"; } ContentResolver cr = getContentResolver(); Cursor cursor = cr.query(Uri.parse(url), null, "title=?", new String[] {getString(R.string.app_name)}, null); if (cursor != null && cursor.moveToFirst()) { cursor.close(); return true; } if (null != cursor) { cursor.close(); } return false;