Get company name in android using new API's
- by HellBoy
Currently I am getting company name using following code
public class ContactsDemo extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Cursor cursor = getContentResolver().query(Contacts.Organizations.CONTENT_URI,
null, null, null, null);
//ContactsContract.CommonDataKinds.
if(cursor!=null){
System.out.println(cursor.getString(cursor.getColumnIndex
(Contacts.Organizations.COMPANY)));
}}}
but I don't want to use deprected API's.
& in new API's there is no CONTENT_URI in Organisation class.
How to get company name using new API.