Thursday, April 2, 2020

Common Share Files Code are not running each phone...use FileProvider

This answer is superb https://stackoverflow.com/a/38858040

Common code use for share files in android:

Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("image/*");
Uri uri = Uri.fromFile(new File(mFilename));
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
mContext.startActivity(Intent.createChooser(shareIntent, "Share with"));
In my case this code is running in Android 7.1.1 Galaxy J2
but this code is not running in Android 8.1.0 Redmi 6A.
Reason is found from this article https://stackoverflow.com/a/32981296
https://medium.com/androiddevelopers/sharing-content-between-android-apps-2e6db9d1368b#.wnlh9s3n7
Solution is found from this article https://stackoverflow.com/a/32982050



No comments:

Post a Comment