我正在尝试从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?