Added 'Export logs' button to bug report page
This commit is contained in:
parent
930642cb36
commit
aa160355c3
|
@ -52,5 +52,19 @@ public class BugReportActivity extends AppCompatActivity {
|
||||||
clipboard.setPrimaryClip(clip);
|
clipboard.setPrimaryClip(clip);
|
||||||
Snackbar.make(findViewById(android.R.id.content), R.string.copied_to_clipboard, Snackbar.LENGTH_SHORT).show();
|
Snackbar.make(findViewById(android.R.id.content), R.string.copied_to_clipboard, Snackbar.LENGTH_SHORT).show();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
findViewById(R.id.btn_export_logcat).setOnClickListener(v -> {
|
||||||
|
try {
|
||||||
|
File filename = new File(UserPreferences.getDataFolder(null), "full-logs.txt");
|
||||||
|
filename.createNewFile();
|
||||||
|
String cmd = "logcat -d -f " + filename.getAbsolutePath();
|
||||||
|
Runtime.getRuntime().exec(cmd);
|
||||||
|
Snackbar.make(findViewById(android.R.id.content),
|
||||||
|
filename.getAbsolutePath(), Snackbar.LENGTH_SHORT).show();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Snackbar.make(findViewById(android.R.id.content), e.getMessage(), Snackbar.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,12 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_export_logcat"
|
||||||
|
android:text="@string/export_logs"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:id="@+id/crash_report_logs"
|
android:id="@+id/crash_report_logs"
|
||||||
|
|
|
@ -489,6 +489,7 @@
|
||||||
<string name="view_mailing_list">View mailing list</string>
|
<string name="view_mailing_list">View mailing list</string>
|
||||||
<string name="bug_report_title">Report bug</string>
|
<string name="bug_report_title">Report bug</string>
|
||||||
<string name="open_bug_tracker">Open bug tracker</string>
|
<string name="open_bug_tracker">Open bug tracker</string>
|
||||||
|
<string name="export_logs">Export logs</string>
|
||||||
<string name="copy_to_clipboard">Copy to clipboard</string>
|
<string name="copy_to_clipboard">Copy to clipboard</string>
|
||||||
<string name="copied_to_clipboard">Copied to clipboard</string>
|
<string name="copied_to_clipboard">Copied to clipboard</string>
|
||||||
<string name="experimental_pref">Experimental</string>
|
<string name="experimental_pref">Experimental</string>
|
||||||
|
|
Loading…
Reference in New Issue