You will need to read the program messages and display them in the ListView in the Activity . Use CheckBox in ListView items and enable multiple items. Find a simple example / tutorial for ListView and start from there.
There are several reasons why it is better to create a custom ListView instead of using Intent(Intent.ACTION_GET_CONTENT); :
- You may not be able to select multiples as you requested.
- Even if you find a way to choose multiplets, it will be every version of the OS and device and may not work on all of them.
- If there are several applications installed on any device that can handle
ACTION_GET_CONTENT , then the user will be presented with a ACTION_GET_CONTENT and he will have to choose one of them. User selection may not support multiple contact selection.
Here is an example that reads your system contacts:
Cursor cursor = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,null, null, null, null); while (cursor.moveToNext()) { String contactId = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID)); String hasPhone = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER)); String name = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)); if("1".equals(hasPhone) || Boolean.parseBoolean(hasPhone)) {
source share