30
31 //从 SIM 卡中取号
32 private void GetSimContact(String add){
33 //读取 SIM 卡手机号,有两种可能:content://icc/adn 与 content://sim/adn
34 try {
35 Intent intent = new Intent();
36 intent.setData(Uri.parse(add));
37 Uri uri = intent.getData();
38 mCursor = getContentResolver().query(uri, null, null, null, null);
39 if (mCursor != null) {
40 while (mCursor.moveToNext()) {
41 ContactInfo sci = new ContactInfo();
42 // 取得联系人名字
43 int nameFieldColumnIndex = mCursor.getColumnIndex("name");
44 sci.contactName = mCursor.getString(nameFieldColumnIndex);
45 // 取得电话号码
46 int numberFieldColumnIndex = mCursor
47 .getColumnIndex("number");
48 sci.userNumber = mCursor.getString(numberFieldColumnIndex);
49 sci.userNumber = GetNumber(sci.userNumber);
50 sci.isChecked = false;
51
52 if (IsUserNumber(sci.userNumber)) {
53 if (!IsContain(contactList, sci.userNumber)) {
54 if(IsAlreadyCheck(wNumStr, sci.userNumber)){
55 sci.isChecked = true;
56 numberStr += "," + sci.userNumber;
57 }
58 contactList.add(sci);
59 //Log.i("eoe", "*********"+sci.userNumber);
60 }
61 }
62 }
63 mCursor.close();
64 }
65 } catch (Exception e) {