Android从意图中获取vCard

时间:2012-10-02 14:14:00

标签: android android-intent vcard

我正在尝试从Intent收到vCard:

// ...

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());
}

但是得到NullPointerException。如何从意图中获取vCard?

0 个答案:

没有答案