Skip to content

Commit

Permalink
Added back arrow in logs screen
Browse files Browse the repository at this point in the history
  • Loading branch information
JuancaG05 committed Aug 31, 2021
1 parent eb7e2ff commit 07463b4
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
package com.owncloud.android.presentation.ui.settings

import android.os.Bundle
import android.view.MenuItem
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
Expand All @@ -46,6 +47,8 @@ class LogHistoryActivity : AppCompatActivity() {

setSupportActionBar(toolbar)

supportActionBar?.setDisplayHomeAsUpEnabled(true)

// Check that the activity is using the layout version with the fragment_container FrameLayout
if (findViewById<View>(R.id.fragment_container) != null) {
// However, if we're being restored from a previous state,
Expand Down Expand Up @@ -83,6 +86,15 @@ class LogHistoryActivity : AppCompatActivity() {
}
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
var retval = true
when (item.itemId) {
android.R.id.home -> finish()
else -> retval = super.onOptionsItemSelected(item)
}
return retval
}

companion object {
private const val logCatTargetFileName = "logfile.log"
private const val logCatSearchHint = "search logcat"
Expand Down

0 comments on commit 07463b4

Please sign in to comment.