Skip to content

Instantly share code, notes, and snippets.

@cyberhck
Created September 14, 2014 15:51
Show Gist options
  • Save cyberhck/99f700680047562e442b to your computer and use it in GitHub Desktop.
Save cyberhck/99f700680047562e442b to your computer and use it in GitHub Desktop.
public class ContactChooser extends ActionBarActivity{
@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_contact_chooser);
Cursor cursor=getContentResolver().query(
ContactsContract.CommonDataKinds.Phone.CONTENT_URI,null,null,null,null,null
);
@SuppressWarnings("deprecation")
SimpleCursorAdapter adapter=new SimpleCursorAdapter(this, R.layout.activity_contact_chooser, cursor, null, null);
ListView lv=new ListView(this);
lv.setAdapter(adapter);
setContentView(lv);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment