0
Staff would like to know how I share an image generated within the app,
in the scope of the app the person writing in the text view captures and generates an image would like to share that image via Whats or email.
private void gerarQRCode() {
String texto = edtTexto.getText().toString();
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
try {
BitMatrix bitmatrix = multiFormatWriter.encode(texto, BarcodeFormat.QR_CODE, 2000, 2000);
BarcodeEncoder barcodeEncoder = new BarcodeEncoder();
Bitmap bitmap = barcodeEncoder.createBitmap(bitmatrix);
ivQRCode.setImageBitmap(bitmap);
} catch (WriterException e) {
e.printStackTrace();
}
}
Thanks Ivan, I’ll try and comment if it went well big hug.
– Almir Kubo
Ivan, gave error, theoretically is generated a bitmap image is that image I would like to share.
– Almir Kubo
Hello @Almirkubo! Please show console error message.
– Ivan Silva
the app the person type a text and appears a qr code that image I can not share with code you showed me it opens the Internet but does not pass =.
– Almir Kubo
This is really weird. This code forces an application selector, I believe that the device has at least one application capable of solving the action. You can not send this image directly to Whatsapp. You must send Uri and let him take care to locate the image by "address". Edit the question with the new code and error log or it will be impossible to resolve the issue.
– Ivan Silva
Got it, thanks Ivan.
– Almir Kubo