1

So I am creating an app based around sending files with an android beam, and it worked earlier with my Sony Xperia z3. But now with my new Oneplus 6, It doesn't seem to send any kinds of files with an android beam. This is my code:

File file = new File("/storage/emulated/0/tests/test1.txt");
                Intent shareIntent = new Intent();
                shareIntent.setAction(Intent.ACTION_SEND);
                shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
                shareIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, appList.get(pos).loadLabel(packageManager));
                shareIntent.setType("file/*");
                MainActivity.mainActivity.startActivityForResult(shareIntent,1);

It works perfectly fine though to, for instance, save it to google drive. Also, It works perfectly fine to send plain text with an android beam, like if I use EXTRA_TEXT instead of EXTRA_STREAM. So do you guys know what has to be done to be able to send files with an android beam?

Emil00
  • 23
  • 4

0 Answers0