如果你想檢查MIME類型的設備支持 - 這裏是你會做什麼
Uri entityUri =
Uri.withAppendedPath(
ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId), Entity.CONTENT_DIRECTORY);
Cursor c =
getContentResolver().query(
entityUri,
new String[] {
RawContacts.SOURCE_ID, Entity.DATA_ID, Entity.MIMETYPE, Entity.DATA1 },
null, null, null);
try {
while (c.moveToNext()) {
String sourceId = c.getString(0);
if (!c.isNull(1)) {
String mimeType = c.getString(2);
String data = c.getString(3);
PackageManager packageManager = context.getPackageManager();
Intent testIntent = new Intent(Intent.ACTION_VIEW);
testIntent.setType(mimeType);
if (packageManager.queryIntentActivities(testIntent, PackageManager.MATCH_DEFAULT_ONLY).size() > 0) {
// do something - it is supported
} else {
return false;
}
}
}
} finally {
c.close();
}
http://stackoverflow.com/questions/8942298/get-contacts-by-mime-type -in-android – Abhi
對不起,但我不想與mimetype關聯的聯繫人。我想設備支持的mimetypes列表@Abhi –