我想直接将图像和文本发送到whatsApp上的转换。我设法为数字打开了未保存的转换,但内容为空
这是我的代码
public void onClickApp(Bitmap bitmap) {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
String path = MediaStore.Images.Media.insertImage(getContentResolver(), bitmap, "Title", null);
Uri imageUri = Uri.parse(path);
String phone = Const.getInstance().getData().getNumber().trim();
Intent sendIntent = new Intent("android.intent.action.MAIN");
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.setComponent(new ComponentName("com.whatsapp", "com.whatsapp.Conversation"));
sendIntent.setType("image/*");
sendIntent.putExtra(android.content.Intent.EXTRA_STREAM, imageUri);
sendIntent.putExtra("jid", phone + "@s.whatsapp.net");
sendIntent.putExtra(Intent.EXTRA_TEXT, "#"+Const.getInstance().getData().getTransactionCode()+" *"+Const.getInstance().getData().getNames()+"* \n"+
"#Order "+Const.getInstance().getData().getReferenceNumber());
sendIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(sendIntent);
}