2

I am trying to receive vCard from Intent:

// ...

Intent intent = getIntent();
String action = intent.getAction();
String type = intent.getType();

if (Intent.ACTION_SEND.equals(action) && type != null) {
    if ("text/plain".equals(type)) {
        handleSendText(intent);
    } else if ("text/x-vcard".equals(type)) {
        handleSendVCard(intent);
    }
}

// ...

private void handleSendVCard(Intent intent) {
    Uri uri = intent.getData();
    Log.d("vCard", uri.toString());
}

But get NullPointerException. How can I get vCard from intent?

Dmytro Zarezenko
  • 10,526
  • 11
  • 62
  • 104

0 Answers0