I am trying to show a different view when the app is browsed in task switcher. This is achieved via a fragment that is attached to the activity.
class ProtectorFragment: Fragment(){
override fun onCreateView(inflater: LayoutInflater, ...): View? {
return inflater.inflate(R.layout.fragment_protector...)
}
override fun onResume() {
super.onResume()
background.visibility = View.GONE
}
override fun onPause() {
super.onPause()
background.visibility = View.VISIBLE
}
}
However, it doesn't work as expected in Android 6,7 & 10 devices. Protector view appears for a second and disappears. No View.GONE / INVISIBLE calls are made.
But, what is more confusing is, Layout inspector shows the protector view. But, device shows a view that is underneath the Protector view. And, the bottom navigation view also always on top whatever the elevation I set.
Any clues?