権限を追加せずに自分のアプリのスクリーンショットを共有することはできますか?WRITE_EXTERNAL_STORAGE権限のないアプリのスクリーンショットを共有しますか?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
そして、これは私の他の人がコピー上の作品は
public void sendFile(File paramFile) {
String fileExtension = ".apk";
File temporaryFile;
try {
temporaryFile = File.createTempFile(paramFile.getName(), fileExtension, getApplicationContext().getExternalCacheDir());
copy(paramFile, temporaryFile);
} catch (Exception e) {
temporaryFile = paramFile;
}
Intent localIntent = new Intent();
localIntent.setAction("android.intent.action.SEND");
localIntent.putExtra("android.intent.extra.STREAM", Uri.fromFile(temporaryFile));
localIntent.setType("application/*");
localIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(Intent.createChooser(localIntent, ""));
}
は間違いありません。どのようにファイルを読んでいなくても共有できますか? – Noorul
いくつかのことをキャッシュに書き込んでから共有しますか? –
試してみてください。絶対にありません。 – Noorul