开发者

choice of contact on mod MIUI

anyone faced with the task of selecting a contact in the fashion MIUI doing so:

startActivityForResult(new Intent(Intent.ACTION_PICK, Phone.CONTENT_URI));
...

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Uri contactData=data.getData();

Cursor c = null;

        try {

            c = context.getContentResolver().query(contactData, null, null, null, null);

            while (c.moveToNext()) {
                String id = c.getString(c.getColumnIndex(Phone.CONTACT_ID));

                String name = c
                        .getString(c.getColumnIndex(Contacts.DISPLAY_NAME));
                String phone = c.getString(c.getColumnIndex(Phone.NUMBER));

                .开发者_开发技巧...

            }           

        } finally {
            if (c != null && !c.isClosed())
                c.close();
        }

}

so this MIUI dumps almost all (maybe all) your contact list

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜