How to call Android contacts list?

前端 未结 13 2262
傲寒
傲寒 2020-11-22 02:50

I\'m making an Android app, and need to call the phone\'s contact list. I need to call the contacts list function, pick a contact, then return to my app with the contact\'s

13条回答
  •  孤城傲影
    2020-11-22 03:39

    public void onActivityResult(int requestCode, int resultCode, Intent intent) 
    {
      if (requestCode == PICK_CONTACT && intent != null) //here check whether intent is null R not
      {  
      }
    }
    

    because without selecting any contact it will give an exception. so better to check this condition.

提交回复
热议问题