Android: onBackPressed() not being called when navigation drawer open

前端 未结 8 1906
粉色の甜心
粉色の甜心 2021-02-05 05:54

I have a main activity that is situated with two navigation drawers. The left one is always accessible, but the right one is used for displaying some necessary lists and perform

8条回答
  •  生来不讨喜
    2021-02-05 06:53

    Put this line into your code:

    mDrawerLayout.setFocusableInTouchMode(false);
    

    Then it will call your overwritten onBackPressed() when you press the back button.

提交回复
热议问题