- case R.id.clear:
- try {
- // Clear the logcat. `-c` clears the logcat. `-b all` clears all the buffers (instead of just crash, main, and system).
- Process process = Runtime.getRuntime().exec("logcat -b all -c");
-
- // Wait for the process to finish.
- process.waitFor();
-
- // Reload the logcat.
- new GetLogcat(this, 0).execute();
- } catch (IOException|InterruptedException exception) {
- // Do nothing.
- }
-
- // Consume the event.
- return true;
+ // Reload the logcat.
+ new GetLogcat(this, 0).execute();
+ } catch (IOException | InterruptedException exception) {
+ // Do nothing.
+ }