本文整理汇总了Java中android.provider.CallLog.Calls.DATE属性的典型用法代码示例。如果您正苦于以下问题:Java Calls.DATE属性的具体用法?Java Calls.DATE怎么用?Java Calls.DATE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.provider.CallLog.Calls
的用法示例。
在下文中一共展示了Calls.DATE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateLoader
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
return new CursorLoader(getActivity(), SipManager.CALLLOG_URI, new String[] {
Calls._ID, Calls.CACHED_NAME, Calls.CACHED_NUMBER_LABEL,
Calls.CACHED_NUMBER_TYPE, Calls.DURATION, Calls.DATE,
Calls.NEW, Calls.NUMBER, Calls.TYPE,
SipManager.CALLLOG_PROFILE_ID_FIELD
},
null, null,
Calls.DEFAULT_SORT_ORDER);
}
示例2: getCalls
private Cursor getCalls (int type) {
Uri llamadasUri = CallLog.Calls.CONTENT_URI;
ContentResolver contentResolver = getContentResolver();
String [] projection = new String [] {Calls._ID, Calls.NUMBER, Calls.DURATION, Calls.TYPE};
String selection = null;
String [] selectionArgs = null;
if (type == Calls.INCOMING_TYPE || type == Calls.OUTGOING_TYPE || type == Calls.MISSED_TYPE || type == Calls.REJECTED_TYPE ) {
selection = Calls.TYPE + " = ? ";
selectionArgs = new String [] {Integer.toString(type)};
}
String order = Calls.DATE + " DESC ";
// verificar permisos de llamada
int permissionCheck = ContextCompat.checkSelfPermission (this, Manifest.permission.READ_CALL_LOG);
if (permissionCheck == PackageManager.PERMISSION_GRANTED) {
cursor = contentResolver.query(llamadasUri, // URI del Content provider
projection, // Columnas a devolver
selection, // Condición a la query
selectionArgs, // Argumentos variables de la condición
order); // Orden de los resultados
}
return cursor;
}
示例3: getDateColumnName
@Override
protected String getDateColumnName() {
return Calls.DATE;
}