You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
etesync-android/app/src/main/java/com/etesync/syncadapter/ui/BaseActivity.kt

36 lines
937 B

package com.etesync.syncadapter.ui
import androidx.appcompat.app.AppCompatActivity
import android.view.MenuItem
import com.etesync.syncadapter.App
open class BaseActivity : AppCompatActivity() {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (item.itemId == android.R.id.home) {
if (!supportFragmentManager.popBackStackImmediate()) {
finish()
}
return true
}
return false
}
override fun onResume() {
super.onResume()
val app = applicationContext as App
val certManager = app.certManager
if (certManager != null)
certManager.appInForeground = true
}
override fun onPause() {
super.onPause()
val app = applicationContext as App
val certManager = app.certManager
if (certManager != null)
certManager.appInForeground = false
}
}