Created
July 23, 2018 13:30
-
-
Save Sankame/67c40ef8056fba82c23937e2ab54b161 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File file = ... | |
// (1) | |
// intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file)); | |
// (2) | |
Uri uri = FileProvider.getUriForFile( | |
【アクティビティ名】.this | |
,getApplicationContext().getPackageName() + ".provider" | |
, file); | |
intent.putExtra(Intent.EXTRA_STREAM, uri); | |
intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION); | |
startActivity(intent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment