I'm doing app to share a png image to facebook and all, the code works fine in my Huawei Honor 8 and crashes with the google pixel 2. code:
showLoading("Saving...");
File f = new File(Environment.getExternalStorageDirectory()
+ File.separator + ""
+ System.currentTimeMillis() + ".png");
photoEditorView.getSource().setImageURI(Uri.fromFile(f));
Uri contentUri = Uri.fromFile(f);
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("image/png");
ContentValues values = new ContentValues();
values.put(MediaStore.Images.Media.TITLE, "title");
values.put(MediaStore.Images.Media.MIME_TYPE, "image/png");
share.putExtra(Intent.EXTRA_STREAM, contentUri);
startActivity(Intent.createChooser(share, "Share Image!"));