Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan09811 authored Mar 9, 2024
1 parent c4c213b commit 667dda8
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ public void onCreatePreferences(@Nullable Bundle savedInstanceState, @Nullable S
});
}

private void shareLogFile() {
// Share the log file
String filePath = "/storage/emulated/0/Android/media/com.panda3ds.pandroid/logs/current.txt";
Uri uri = Uri.parse("file://" + filePath);
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(intent, "Share Log File"));
}
private void shareLogFile() {
// Share The Log File
String filePath = "/storage/emulated/0/Android/media/com.panda3ds.pandroid/logs/current.txt";
File file = new File(filePath);
Uri uri = FileProvider.getUriForFile(requireContext(), "com.panda3ds.pandroid.fileprovider", file);

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_STREAM, uri);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(Intent.createChooser(intent, "Share Log File"));
}

private String getVersionName() {
try {
Expand Down

0 comments on commit 667dda8

Please sign in to comment.