title: Contact Picker not returning result
body: <p>From input box, I am throwing a dialog to pick up the contacts. My code looks like below </p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          toContacts = (EditText)findViewById(R.id.To);
          toContacts.setOnClickListener(new EditText.OnClickListener(){public void onClick(View v){pickContacts();}});
  
      }
  
      public void pickContacts(){
          Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
          startActivityForResult(intent, 1);
      }
  
      public void onActivityResult(int reqCode, int resultCode, Intent data){
          super.onActivityResult(reqCode, resultCode, data);
          String name = "";
            switch (reqCode) {
              case (1) :
                if (resultCode == Activity.RESULT_OK) {
                  Uri contactData = data.getData();
                  //@SuppressWarnings("deprecation")
                  Cursor c = null;
                  try{
                       //c =  managedQuery(contactData, null, null, null, null);
                       c = getContentResolver().query(contactData, null, Contacts.DISPLAY_NAME, null, null);
                       if (c.moveToFirst()) {
                            name = c.getString(c.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
                            //String number = c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
  
                          }
                  } catch(Exception e){
                      Log.e(DEBUG_TAG, "failed to get contacts data", e);
                  } finally {
                      if(c != null){
                          c.close();
                      }
                      EditText toSendContact = (EditText) findViewById(R.id.To);
                      toSendContact.setText(name);
                  }
                }
                break;
            }
  
      }
  </code></pre>
  
  <p>But it is not returning the selected result back in input box. </p>