今天Google将AppCompat库更新到版本22.1.0,现在我们可以使用AppCompatActivity而不是ActionBaractivity. 
 
这意味着我们不再需要在我们的活动布局中拥有工具栏视图.
这意味着我们不再需要在我们的活动布局中拥有工具栏视图.
问题是为了创建一个抽屉切换按钮,我不能再使用新的ActionBarDrawerToggle,因为它需要一个不存在的Toolbar参数.
现在我应该如何将切换按钮添加到ActionBar?
解决方法
 一个可能的解决方案 
  
 
        活动:
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
public class MainActivity extends AppCompatActivity 
{
    DrawerLayout drawerLayout;
    ActionBarDrawerToggle toggle;
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
        getSupportActionBar().setdisplayHomeAsUpEnabled(true);
        getSupportActionBar().setHomeButtonEnabled(true);
        toggle = new ActionBarDrawerToggle
            (
                    this,drawerLayout,R.string.navigation_drawer_open,R.string.navigation_drawer_close
            )
            {
            };
        drawerLayout.setDrawerListener(toggle);
        toggle.syncState();
    }
    @Override
    public boolean onoptionsItemSelected(MenuItem item)
    {
        if (toggle.onoptionsItemSelected(item))
        {
            return true;
        }
        return super.onoptionsItemSelected(item);
    }
} 
 布局:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
    <FrameLayout
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    <ListView
        android:id="@+id/list_drawer"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="#f1f2f7"
        android:choiceMode="singleChoice"
        android:divider="@android:color/transparent" />
</android.support.v4.widget.DrawerLayout> 
 款式:
<resources>
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    </style>
</resources> 
 您的应用程序继承AppCompat主题很重要.
如果用工具栏替换了actionbar,那么请不要忘了在styles.xml中删除这行:
<item name="windowActionBar">false</item>
毕业:
dependencies {
    compile filetree(dir: 'libs',include: ['*.jar'])
    compile 'com.android.support:support-v4:22.1.1'
    compile 'com.android.support:appcompat-v7:22.1.1'
} 
 我把这段代码放在github:https://github.com/bbouabou/AppCompatActivity-With-ActionBarDrawerToggle上.