Android 共享文本+;通过WhatsApp的URL

Android 共享文本+;通过WhatsApp的URL,android,android-intent,share,whatsapp,Android,Android Intent,Share,Whatsapp,我想通过WhatsApp共享文本和URL 我查看了一些链接,但它只有共享文本功能 如何共享URL+文本? 以下是我到目前为止所做的尝试 Intent whatsappIntent = new Intent(Intent.ACTION_SEND); whatsappIntent.setType("text/plain"); whatsappIntent.setPackage("com.whatsapp"); whatsappIntent.putExtra(Intent.EXTRA_TEXT, "T

我想通过WhatsApp共享文本和URL

我查看了一些链接,但它只有共享文本功能

如何共享URL+文本?

以下是我到目前为止所做的尝试

Intent whatsappIntent = new Intent(Intent.ACTION_SEND);
whatsappIntent.setType("text/plain");
whatsappIntent.setPackage("com.whatsapp");
whatsappIntent.putExtra(Intent.EXTRA_TEXT, "The text you wanted to share");
try {
    activity.startActivity(whatsappIntent);
} catch (android.content.ActivityNotFoundException ex) {
    ToastHelper.MakeShortText("Whatsapp have not been installed.");
}

我知道这是非常古老的,但将url(作为文本)连接到文本对我来说非常有用

Intent sendIntent = new Intent();
                sendIntent.setAction(Intent.ACTION_SEND);
                sendIntent.putExtra(Intent.EXTRA_TEXT, "this my text https://www.google.co.in/webhp?ei=6cLkV8utKMnp0ASg5L7oAw&yv=2&rct=j");
                sendIntent.setType("text/plain");
                sendIntent.setPackage("com.whatsapp");
                startActivity(sendIntent);