Replace deprecated android.support.v4.app.ActionBarDrawerToggle with support.v7 version cause drawer not works on Jelly Bean

前端 未结 1 1113
离开以前
离开以前 2020-12-30 07:42

Following the answer in this question i have replaced ActionBarDrawerToggle of support v4 library that in latest update(rev 21) has been deprecated with the la

1条回答
  •  爱一瞬间的悲伤
    2020-12-30 08:37

    1. To get ActionBarDrawerToggle v7 to work properly you need to extends your Activity class from android.support.v7.app.ActionBarActivity
    2. ActionBarActivity v7 must be used with Theme.AppCompat theme from the appcompat-v7:21 support library.
    3. Unless you want to switch from ActionBar to ToolBar, don't add false when extending Theme.AppCompat. Doing so will make your ActionBarActivity have no default ActionBar decor, and getSupportActionBar will return null. You'll need to provide your own ToolBar and call setSupportActionBar first to make getSupportActionBar work.

    0 讨论(0)
提交回复
热议问题