Skip to content

Commit

Permalink
add functions for share log option
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan09811 authored Mar 8, 2024
1 parent 1cafa91 commit 70439b2
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ public void onCreatePreferences(@Nullable Bundle savedInstanceState, @Nullable S
setItemClick("input", (item) -> PreferenceActivity.launch(requireContext(), InputPreferences.class));
setItemClick("general", (item)-> PreferenceActivity.launch(requireContext(), GeneralPreferences.class));
setItemClick("advanced", (item)-> PreferenceActivity.launch(requireContext(), AdvancedPreferences.class));
setItemClick("share_log", (item)-> {
// Share Log File
shareLogFile();
});
}

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 String getVersionName() {
Expand Down

0 comments on commit 70439b2

Please sign in to comment.