如何在Android 5.0或更高版本中通过意图发送彩信?

时间:2018-03-14 15:33:17

标签: android android-intent

String defaultSmsPackageName = Telephony.Sms.getDefaultSmsPackage(getActivity());
        Intent sharingIntent = new Intent(Intent.ACTION_SEND_MULTIPLE);
        sharingIntent.setPackage(defaultSmsPackageName);
        sharingIntent.setData(Uri.parse("address" + "1234567890"));
        sharingIntent.putExtra("sms_body", "Hi how are you");
        sharingIntent.putExtra(Intent.EXTRA_STREAM, ImageUri);
        sharingIntent.setType("*/*");
        startActivity(Intent.createChooser(sharingIntent,"Send"));

我试过这段代码,但它不适用于5.0及更高版本的android。

0 个答案:

没有答案