[android] get call log with call type

String[] projection = { CallLog.Calls.CACHED_NAME, CallLog.Calls.NUMBER, CallLog.Calls.DATE };
String selection = CallLog.Calls.TYPE + " = ?";
String[] selectionArgs = { CallLog.Calls.MISSED_TYPE + "" }; // CallLog.Calls.INCOMING_TYPE, CallLog.Calls.OUTGOING_TYPE
Cursor cursor = _context.getContentResolver().query(CallLog.Calls.CONTENT_URI, projection, selection, selectionArgs,
      CallLog.Calls.DEFAULT_SORT_ORDER);

if (cursor == null || cursor.getCount() == 0)
   return;

cursor.moveToFirst();

while (!cursor.isAfterLast())
{
   String name = cursor.getString(cursor.getColumnIndex(CallLog.Calls.CACHED_NAME));
   String phone = cursor.getString(cursor.getColumnIndex(CallLog.Calls.NUMBER));
   long datetimeMillis = cursor.getLong(cursor.getColumnIndex(CallLog.Calls.DATE));

   // TODO

   cursor.moveToNext();
}
cursor.close();