我必须将pdf发送给不在我的whatsapp联系人列表中的特定联系人。我可以发送pdf但会询问发送到哪个号码。我想发送字符串电话中可用的号码。请帮助。这里是我的代码:
File pdfFile = new File(Environment.getExternalStorageDirectory() +
"/" +
"Rentalin" + "/" + "invoice.pdf");
Uri path = Uri.fromFile(pdfFile);
String smsNumber = phone;
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("application/pdf");
intent.putExtra("jid", smsNumber + "@s.whatsapp.net");
intent.setPackage("com.whatsapp");
intent.putExtra(Intent.EXTRA_STREAM, path);//
getActivity().startActivity(intent);