Я пытаюсь поделиться текстом с изображением в Line, но когда я соединяю их вместе, отображается только изображение, но не текст. Есть ли другой способ сделать это или Line просто не поддерживает это? (это работает, если поделиться им через Gmail и Discord)
ниже приведен мой код:
public void share(){
Drawable drawable = ContextCompat.getDrawable(this, R.drawable.image);
Bitmap bitmap = ((BitmapDrawable) drawable).getBitmap();
// Save the bitmap to a file
try {
File file = new File(getExternalCacheDir(), "shared_image.png");
FileOutputStream outputStream = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, outputStream);
outputStream.flush();
outputStream.close();
Uri imageUri = FileProvider.getUriForFile(this, "com.example.myapplication.provider", file);
// Create the share intent
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("image/*");
shareIntent.putExtra(Intent.EXTRA_TEXT, "HI");
shareIntent.putExtra(Intent.EXTRA_STREAM, imageUri);
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(Intent.createChooser(shareIntent, "Share Image"));
} catch (Exception e) {
e.printStackTrace();
}
}
Подробнее здесь: https://stackoverflow.com/questions/790 ... o-line-app