title: Where is address field in android ContactsContract
body: <p>I'm trying to retrieve the address of a contact using the activity's content resolver. There is no Address field anywhere. I tried ContactsContract.CommonDataKinds.StructuredPostal.STREET but it also gives me a different value. Please see the screen shot of how the field looks like in android which I'm trying to retrieve.</p>
  <p>In my code below, I'm iterating through all values in the CONTENT_URI for 'John Doe', but this address, &quot;Slaughter Lane&quot; never shows up i.e. my breakpoint at the Timber log command 'Found the address' is never hit.</p>
  <pre><code>fun getContact(activity: FragmentActivity, name: String): Contact? {
      var contact = Contact()
      val cr : ContentResolver = activity.contentResolver
      var selectionArgs: Array&lt;String&gt; = arrayOf(&quot;John Doe&quot;)
      val cursor = cr.query(
          ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
          null,
          &quot;DISPLAY_NAME = ?&quot;,
          selectionArgs,
          ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + &quot; ASC&quot;
      )
      if (cursor != null) {
          try {
              while (cursor.moveToNext()) {
                  cursor.columnNames.forEach {
                      var stringValue: String? = cursor.getString(cursor.getColumnIndex(it))
                      if (stringValue!=null) {
                          if (stringValue.contains(&quot;Slaughter&quot;)){
                              Timber.i(&quot;Found the address&quot;);
                          }
                      }
                  }
              }
          } finally {
              cursor.close()
          }
      }
      return if (contact.name != null) contact else null
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/NyCQX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NyCQX.png" alt="screen shot" /></a></p>