mirror of
https://github.com/fcitx5-android/fcitx5-android.git
synced 2026-08-02 04:44:35 +08:00
Simplify LogActivity onCreate by removing unnecessary block
This commit is contained in:
parent
8d2f05713d
commit
60cd2c7cb6
@ -73,27 +73,22 @@ class LogActivity : AppCompatActivity() {
|
||||
}
|
||||
setContentView(binding.root)
|
||||
setSupportActionBar(binding.toolbar)
|
||||
with(binding) {
|
||||
setSupportActionBar(toolbar)
|
||||
this@LogActivity.logView = logView
|
||||
if (intent.hasExtra(FROM_CRASH)) {
|
||||
fromCrash = true
|
||||
supportActionBar!!.setTitle(R.string.crash_logs)
|
||||
AlertDialog.Builder(this@LogActivity)
|
||||
.setTitle(R.string.app_crash)
|
||||
.setMessage(R.string.app_crash_message)
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show()
|
||||
logView.append("--------- Crash stacktrace")
|
||||
logView.append(intent.getStringExtra(CRASH_STACK_TRACE) ?: "<empty>")
|
||||
logView.setLogcat(Logcat(FcitxApplication.getLastPid()))
|
||||
} else {
|
||||
supportActionBar!!.apply {
|
||||
setDisplayHomeAsUpEnabled(true)
|
||||
setTitle(R.string.real_time_logs)
|
||||
}
|
||||
logView.setLogcat(Logcat())
|
||||
}
|
||||
this@LogActivity.logView = binding.logView
|
||||
if (intent.hasExtra(FROM_CRASH)) {
|
||||
fromCrash = true
|
||||
supportActionBar!!.setTitle(R.string.crash_logs)
|
||||
AlertDialog.Builder(this@LogActivity)
|
||||
.setTitle(R.string.app_crash)
|
||||
.setMessage(R.string.app_crash_message)
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show()
|
||||
logView.append("--------- Crash stacktrace")
|
||||
logView.append(intent.getStringExtra(CRASH_STACK_TRACE) ?: "<empty>")
|
||||
logView.setLogcat(Logcat(FcitxApplication.getLastPid()))
|
||||
} else {
|
||||
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
|
||||
supportActionBar!!.setTitle(R.string.real_time_logs)
|
||||
logView.setLogcat(Logcat())
|
||||
}
|
||||
registerLauncher()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user