How to import selected contacts to my application?

61 views Asked by At

Java Code: `

public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                 Bundle savedInstanceState) {
            // Inflate the layout for this fragment
            viewRoot = inflater.inflate(R.layout.fragment_contacts, container, 
            false);
            Button btnAdd = (Button) viewRoot.findViewById(R.id.btn_add_contacts);
            btnAdd.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent = new Intent(Intent.ACTION_PICK, 
                    ContactsContract.Contacts.CONTENT_URI);
                    startActivityForResult(intent,1);
                    Toast.makeText(getContext(), "Add Contacts", 
                    Toast.LENGTH_SHORT).show();
                }
            });
            return viewRoot;
        }

`
Now i want to select the contacts from a list and then add them to a list view.

0

There are 0 answers