如何获得Android中Progrmmatically所有SIM卡联系人? [英] How to get All Sim Contacts in Android Progrmmatically?

查看:142
本文介绍了如何获得Android中Progrmmatically所有SIM卡联系人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人可以帮助我: - 如何列出的Andr​​oid编程SIM卡联系人。我得到了code拿到手机通讯录<一个href=\"http://stackoverflow.com/questions/4133163/how-to-get-phone-contacts-in-android/13737976#comment18889423_13737976\">here但我需要SIM卡联系人也与此有关。

由于提前


解决方案

 乌里simUri = Uri.parse(内容:// ICC / ADN);  光标cursorSim = this.getContentResolver()查询(simUri,NULL,NULL,NULL,NULL);         而(cursorSim.moveToNext()){
             listName.add(cursorSim.getString(cursorSim.getColumnIndex(名称)))​​;
             listContactId.add(cursorSim.getString(cursorSim.getColumnIndex(_ ID)));
             listMobileNo.add(cursorSim.getString(cursorSim.getColumnIndex(数字)));
            }


  

只是现在下面code得到details..It工作正常的卡贴


Can Anybody help me :- How to list sim contacts in android Programmatically. I got the code to get phone contacts here but I need sim contacts too with this.

Thanks in Advance

解决方案

Uri simUri = Uri.parse("content://icc/adn");

  Cursor cursorSim = this.getContentResolver().query(simUri, null, null,null, null);

         while (cursorSim.moveToNext()) {           
             listName.add(cursorSim.getString(cursorSim.getColumnIndex("name")));
             listContactId.add(cursorSim.getString(cursorSim.getColumnIndex("_id")));      
             listMobileNo.add(cursorSim.getString(cursorSim.getColumnIndex("number")));
            }

simply now following code to get the simcard details..It works fine

这篇关于如何获得Android中Progrmmatically所有SIM卡联系人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆