本文整理匯總了Java中android.provider.ContactsContract.Data.CONTENT_URI屬性的典型用法代碼示例。如果您正苦於以下問題:Java Data.CONTENT_URI屬性的具體用法?Java Data.CONTENT_URI怎麽用?Java Data.CONTENT_URI使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.provider.ContactsContract.Data
的用法示例。
在下文中一共展示了Data.CONTENT_URI屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreateLoader
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
// Choose the proper action
switch (id) {
case DETAILS_QUERY_ID:
// Assigns the selection parameter
mSelectionArgs[0] = mLookupKey;
Log.i("Info","Key"+mLookupKey);
// Starts the query
CursorLoader mLoader =
new CursorLoader(
getActivity(),
Data.CONTENT_URI,
PROJECTION,
SELECTION,
mSelectionArgs,
SORT_ORDER
);
return mLoader;
}
return null;
}
示例2: getCSipPhonesContact
@Override
public List<String> getCSipPhonesContact(Context ctxt, Long contactId) {
ArrayList<String> results = new ArrayList<String>();
Uri dataUri = Data.CONTENT_URI;
String dataQuery = Data.MIMETYPE + "='" + CommonDataKinds.Im.CONTENT_ITEM_TYPE + "' "
+ " AND "
+ CommonDataKinds.Im.PROTOCOL + "=" + CommonDataKinds.Im.PROTOCOL_CUSTOM
+ " AND "
+ " LOWER(" + CommonDataKinds.Im.CUSTOM_PROTOCOL + ")='"+SipManager.PROTOCOL_CSIP+"'";
// get csip data
Cursor dataCursor = ctxt.getContentResolver()
.query(dataUri,
new String[] {
CommonDataKinds.Im._ID,
CommonDataKinds.Im.DATA,
},
dataQuery + " AND " + CommonDataKinds.Im.CONTACT_ID + "=?",
new String[] {
Long.toString(contactId)
}, null);
try {
if (dataCursor != null && dataCursor.getCount() > 0) {
dataCursor.moveToFirst();
String val = dataCursor.getString(dataCursor
.getColumnIndex(CommonDataKinds.Im.DATA));
if (!TextUtils.isEmpty(val)) {
results.add(val);
}
}
} catch (Exception e) {
Log.e(THIS_FILE, "Error while looping on data", e);
} finally {
dataCursor.close();
}
return results;
}
示例3: getDataContentUri
/**
* Get Data.CONTENT_URI for EmailAddressAdapter.
*/
public static Uri getDataContentUri() {
return Data.CONTENT_URI;
}
示例4: getUriPersonLookupKey
@Override
public Uri getUriPersonLookupKey() {
return Data.CONTENT_URI;
}