title: how to get the number type of a contact in android?
body: <p>I'm developing an application that uses the contacts ! to do some work ! and one of the most important things is the number type ! </p>
  
  <p>so if one contact have more than one number ! I need to get the number and the types ! 
  I don't wan't to make the switch statement like this one </p>
  
  <pre><code>                int type = phones.getInt(phones.getColumnIndex(Phone.TYPE));
                  switch (type) {
                      case Phone.TYPE_HOME:
                          // do something with the Home number here...
                          break;
                      case Phone.TYPE_MOBILE:
                          // do something with the Mobile number here...
                          break;
                      case Phone.TYPE_WORK:
                          // do something with the Work number here...
                          break;
                   }
  </code></pre>
  
  <p>I need to get the type TEXT dynamiclly because most likely the my app works on the custom type ! 
  not only Mobile and Work ... etc. </p>
  
  <p>any help ? </p>
  
  <p>EDIT : </p>
  
  <p>I'm trying to get the contacts as this query :</p>
  
  <blockquote>
    <p>Cursor phones = cr.query(Phone.CONTENT_URI, null, Phone.CONTACT_ID + "
    = " + id, null, null);</p>
  </blockquote>