Fetch Contacts in android application

前端 未结 5 472
谎友^
谎友^ 2020-12-15 07:17

I was following these links to get the contacts in my application

How to call Android contacts list?

http://www.higherpass.com/Android/Tutorials/Working-Wit

5条回答
  •  时光说笑
    2020-12-15 07:53

    Simply, have a contact data object, and whenever you select any item in list, set value of that contact into this field.

    in

    AdapterView.onItemClickListener()
    {
       public void onItemClick(AdapterView list, View view, int position, long id)
       {
          Contact contact=listContacts.get(position);
          selectedContact=contact;//If Done Button on List
          //if activity is to be finished on selection
          { 
             Intent intent=new Intent();
             intent.putExtra(KEY_NAME, contact.Name);
             ....
             setResult(RESULT_OK, intent);
             finish();
          }
        }
    }
    

提交回复
热议问题