Source:
protected void onCreate(final Bundle savedInstanceState) { assureCorrectAppLanguage(this); super.onCreate(savedInstanceState); ThemeHelper.setTheme(this); setContentView(R.layout.activity_error); Intent intent = getIntent(); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setTitle(R.string.error_report_title); actionBar.setDisplayShowTitleEnabled(true); } Button reportEmailButton = findViewById(R.id.errorReportEmailButton); Button copyButton = findViewById(R.id.errorReportCopyButton); Button reportGithubButton = findViewById(R.id.errorReportGitHubButton); userCommentBox = findViewById(R.id.errorCommentBox); TextView errorView = findViewById(R.id.errorView); TextView infoView = findViewById(R.id.errorInfosView); TextView errorMessageView = findViewById(R.id.errorMessageView); ActivityCommunicator ac = ActivityCommunicator.getCommunicator(); returnActivity = ac.getReturnActivity(); errorInfo = intent.getParcelableExtra(ERROR_INFO); errorList = intent.getStringArrayExtra(ERROR_LIST); addGuruMeditation(); currentTimeStamp = getCurrentTimeStamp(); reportEmailButton.setOnClickListener((View v) -> { openPrivacyPolicyDialog(this, "EMAIL"); }); copyButton.setOnClickListener((View v) -> { ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); ClipData clip = ClipData.newPlainText( "NewPipe error report", buildMarkdown()); clipboard.setPrimaryClip(clip); Toast.makeText(this, R.string.msg_copied, Toast.LENGTH_SHORT).show(); }); reportGithubButton.setOnClickListener((View v) -> { openPrivacyPolicyDialog(this, "GITHUB"); }); buildInfo(errorInfo); if (errorInfo.message != 0) { errorMessageView.setText(errorInfo.message); } else { errorMessageView.setVisibility(View.GONE); findViewById(R.id.messageWhatHappenedView).setVisibility(View.GONE); } errorView.setText(formErrorText(errorList)); for (String e : errorList) { Log.e(TAG, e); } }

Target:
protected void onCreate(final Bundle savedInstanceState) { assureCorrectAppLanguage(this); super.onCreate(savedInstanceState); ThemeHelper.setTheme(this); setContentView(R.layout.activity_error); Intent intent = getIntent(); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setTitle(R.string.error_report_title); actionBar.setDisplayShowTitleEnabled(true); } final Button reportEmailButton = findViewById(R.id.errorReportEmailButton); final Button copyButton = findViewById(R.id.errorReportCopyButton); final Button reportGithubButton = findViewById(R.id.errorReportGitHubButton); userCommentBox = findViewById(R.id.errorCommentBox); TextView errorView = findViewById(R.id.errorView); TextView infoView = findViewById(R.id.errorInfosView); TextView errorMessageView = findViewById(R.id.errorMessageView); ActivityCommunicator ac = ActivityCommunicator.getCommunicator(); returnActivity = ac.getReturnActivity(); errorInfo = intent.getParcelableExtra(ERROR_INFO); errorList = intent.getStringArrayExtra(ERROR_LIST); addGuruMeditation(); currentTimeStamp = getCurrentTimeStamp(); reportEmailButton.setOnClickListener((View v) -> { openPrivacyPolicyDialog(this, "EMAIL"); }); copyButton.setOnClickListener((View v) -> { ShareUtils.copyToClipboard(this, buildMarkdown()); Toast.makeText(this, R.string.msg_copied, Toast.LENGTH_SHORT).show(); }); reportGithubButton.setOnClickListener((View v) -> { openPrivacyPolicyDialog(this, "GITHUB"); }); buildInfo(errorInfo); if (errorInfo.message != 0) { errorMessageView.setText(errorInfo.message); } else { errorMessageView.setVisibility(View.GONE); findViewById(R.id.messageWhatHappenedView).setVisibility(View.GONE); } errorView.setText(formErrorText(errorList)); for (String e : errorList) { Log.e(TAG, e); } }