主题:如何获取系统文件名称及路径

来源:互联网 发布:阿里的域名泛解析 编辑:程序博客网 时间:2024/05/23 10:51

 

  1. //get system contacts   
  2.                 Uri mContacts = People.CONTENT_URI;   
  3.                 Cursor cur = managedQuery(mContacts, columns, // 要返回的数据字段   
  4.                                 null// WHERE子句   
  5.                                 null// WHERE 子句的参数   
  6.                                 null // Order-by子句   
  7.                 );   
  8.                 if (cur.moveToFirst()) {   
  9.                         String name = null;   
  10.                         String phoneNo = null;   
  11.                         for(int i=0, count=0; i<cur.getCount(); i++)   
  12.                         {   
  13.                                 name = cur.getString(cur.getColumnIndexOrThrow(People.NAME));   
  14.                                 phoneNo = cur.getString(cur.getColumnIndexOrThrow(People.NUMBER));   
  15.                                    
  16.                                 if(null!=phoneNo && isPhoneNumberValid(phoneNo))   
  17.                                 {   
  18.                                         /*格式化手机号码*/  
  19.                                         names.add(count, name);   
  20.                                         phoneNos.add(count, phoneNo.replaceAll("-"""));   
  21.                                         count++;   
  22.                                 }   
  23.                                 cur.moveToNext();   
  24.                         }   
  25.                 }//end get  
原创粉丝点击