Created
September 14, 2014 15:51
-
-
Save cyberhck/99f700680047562e442b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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