Android: how to share a contact through intention?

How can I share an Android contact with an intention?

I tried so, but for some reason I think I need to forward the contact identifier in a different way:

            Intent intent = new Intent(Intent.ACTION_SEND);
            Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(con.id));
            intent.setData(uri);
            startActivity(intent);
+4
source share
1 answer

How can I share an Android contact with an intention?

It is unlikely that you can do this. A contact is a series of database records, and as such cannot usually be passed through ACTION_SEND.

, setData() ACTION_SEND. EXTRA_TEXT EXTRA_STREAM Uri MIME Intent MIME EXTRA_TEXT (text/plain) EXTRA_STREAM. ACTION_SEND .

, , , , , Uri in EXTRA_STREAM (, , FileProvider), .

HTML, , , , , (, ). , vCard, , .

+1

All Articles