最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android 調(diào)用系統(tǒng)聯(lián)系人界面(添加聯(lián)系人,添加已有聯(lián)系人,編輯和修改)

 更新時(shí)間:2017年03月07日 15:56:09   作者:三世銅棺  
這篇文章主要介紹了Android 調(diào)用系統(tǒng)聯(lián)系人界面(添加聯(lián)系人,添加已有聯(lián)系人,編輯和修改),非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下

一、添加聯(lián)系人

Intent addIntent = new Intent(Intent.ACTION_INSERT,Uri.withAppendedPath(Uri.parse("content://com.android.contacts"), "contacts"));
      addIntent.setType("vnd.android.cursor.dir/person");
      addIntent.setType("vnd.android.cursor.dir/contact");
      addIntent.setType("vnd.android.cursor.dir/raw_contact");
addIntent.putExtra(ContactsContract.Intents.Insert.NAME,number);
名稱(chēng):      addIntent.putExtra(android.provider.ContactsContract.Intents.Insert.PHONE, numberForNewConstant);
電話:
      startActivity(addIntent);

二、添加到已有聯(lián)系人

LogUtil.logI("================btnAddToOladContact=====================");
      Intent oldConstantIntent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
      oldConstantIntent.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
      oldConstantIntent.putExtra(ContactsContract.Intents.Insert.PHONE, numberForNewConstant);
      oldConstantIntent.putExtra(ContactsContract.Intents.Insert.PHONE_TYPE, 3);
      startActivity(oldConstantIntent);
      if(oldConstantIntent.resolveActivity(getActivity().getPackageManager()) != null){
        LogUtil.logI("================btnAddToOladContact=========yes============");
        startActivity(oldConstantIntent);
      }else
        LogUtil.logI("================btnAddToOladContact=========no============");

三、編輯聯(lián)系人

Intent editIntent = new Intent(Intent.ACTION_EDIT,Uri.parse("content://com.android.contacts/contacts/"+cb.getContactId()));
            startActivity(editIntent);

四、刪除聯(lián)系人

//*************刪除聯(lián)系人******************
                Uri deleteUri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, cb.getContactId());
                Uri lookupUri = ContactsContract.Contacts.getLookupUri(ContactsDetailActivity.this.getContentResolver(), deleteUri);
                if (lookupUri != Uri.EMPTY) {
                  int del = ContactsDetailActivity.this.getContentResolver().delete(deleteUri, null, null);
                  LogUtil.logI("==========popupMenu============del:"+del);
                }

以上所述是小編給大家介紹的Android 調(diào)用系統(tǒng)聯(lián)系人界面(添加聯(lián)系人,添加已有聯(lián)系人,編輯和修改),希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論

平湖市| 民权县| 磴口县| 盈江县| 湄潭县| 澄城县| 新沂市| 文登市| 隆安县| 林甸县| 沙雅县| 庆元县| 会同县| 禹州市| 望江县| 衢州市| 平利县| 乐平市| 寿宁县| 浦东新区| 山西省| 海南省| 商南县| 准格尔旗| 治县。| 涿州市| 牙克石市| 合江县| 扶余县| 新野县| 儋州市| 韩城市| 稷山县| 沐川县| 汨罗市| 涟源市| 西宁市| 达拉特旗| 霍山县| 浦东新区| 原平市|