title: Android - Pick multiple contacts
body: <p>I'm aware that there is some old answer on here regarding on how to do this but was hoping for a more updated version.</p>
  
  <p>I want to let the user pick multiple contacts from their phone and add it to an array.
  I'm using ContactContract with PICK_CONTENT.</p>
  
  <p>So far I have got the following:</p>
  
  <pre><code>public void onActivityResult(int reqCode, int resultCode, Intent data){
          super.onActivityResult(reqCode,resultCode,data);
  
          switch (reqCode){
              case(PICK_CONTACT):
                  if(resultCode == Activity.RESULT_OK){
                      Uri contactData = data.getData();
                      Cursor phone = getContentResolver().query(contactData,null,null,null,null);
                      PlayerDetails player = new PlayerDetails(); //TODO turn this into a loop to add each player the user picks and then display it
                      if(phone.moveToFirst()) {
  
                          player.name = phone.getString(phone.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
                          player.number =phone.getString(phone.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
                          playerListGame.addPlayer(player);
  </code></pre>
  
  <p>But this clicking a button to launch this activity and then :</p>
  
  <pre><code> public void showPlayerGameList(){
          playerTextView = findViewById(R.id.aPlayerBox);
          for(PlayerDetails i : playerListGame.myPlayers){
              playerTextView.append(i.name + "\n" + i.number); //TODO sort this out so it doesnt repeat the same names
          }
      }
  </code></pre>
  
  <p>Then I loop through the array I add it to, to display the info I need.</p>
  
  <p>I don't know how to get the application to allow the user to select multiple users</p>
  
  <p>Thanks</p>