I have a NavigationView in my app. I want to open the NavigationView when resent apps navigation button is clicked. I tried this:
@Override
protected void onPause () {
if(!(drawer.isDrawerOpen(GravityCompat.START))){
drawer.openDrawer(GravityCompat.START);
}
super.onPause();
}
But it opened recent apps and NavigationView together. Is there any way to open NavigationView when recent app button is clicked?
onPause()is not unique to your desired scenario. There are many things that triggeronPause(), including system HOME navigation and configuration changes (e.g., screen rotation).No:
There may not be such a button, such as on the millions of devices that use gesture navigation
Apps are not informed about when that button gets clicked
Apps cannot interfere with the operation of that button