Skip to content

Commit

Permalink
Android Q AOSP memory leak workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
G00fY2 committed Sep 4, 2019
1 parent a75615a commit 1875211
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ abstract class BaseActivity(@LayoutRes contentLayoutId: Int, private val isDialo
lifecycle.removeObserver(providePresenter())
}

// TODO check if there will be a fix for https://issuetracker.google.com/issues/139738913 in AppCompatActivity or next Android release
override fun onBackPressed() {
if (VERSION.SDK_INT == VERSION_CODES.Q && isTaskRoot && supportFragmentManager.backStackEntryCount == 0) {
finishAfterTransition()
} else {
super.onBackPressed()
}
}

protected fun setActionbarElevationListener(viewGroup: ViewGroup) {
supportActionBar?.elevation = 0f
viewGroup.viewTreeObserver.addOnScrollChangedListener {
Expand Down

0 comments on commit 1875211

Please sign in to comment.