android statusbar hiding navigationdrawer
<p>I have a navigation drawer with this code:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout"
    android:fitsSystemWindows="true"
    android:layout_width="match_parent" android:layout_height="match_parent"
    tools:openDrawer="start"&gt;


    &lt;!--&lt;android.support.design.widget.AppBarLayout android:layout_height="wrap_content"--&gt;
        &lt;!--android:layout_width="match_parent" android:theme="@style/AppTheme.AppBarOverlay"&gt;--&gt;

        &lt;!--&lt;android.support.v7.widget.Toolbar android:id="@+id/toolbar"--&gt;
            &lt;!--android:layout_width="match_parent" android:layout_height="?attr/actionBarSize"--&gt;
            &lt;!--android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" /&gt;--&gt;

    &lt;!--&lt;/android.support.design.widget.AppBarLayout&gt;--&gt;

    &lt;FrameLayout
        android:id="@+id/content_frame"
        android:layout_width="match_parent"
        android:background="#000000"
        android:layout_height="match_parent" &gt;
    &lt;/FrameLayout&gt;


    &lt;!--&lt;android.support.design.widget.AppBarLayout android:layout_height="wrap_content"--&gt;
        &lt;!--android:layout_width="match_parent" android:theme="@style/AppTheme.AppBarOverlay"&gt;--&gt;

    &lt;!--&lt;/android.support.design.widget.AppBarLayout&gt;--&gt;

    &lt;!--&lt;include--&gt;
        &lt;!--layout="@layout/app_bar_home_page"--&gt;
        &lt;!--android:layout_width="match_parent"--&gt;
        &lt;!--android:layout_height="match_parent" /&gt;--&gt;

    &lt;android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        app:headerLayout="@layout/nav_header_home_page"
        app:menu="@menu/activity_home_page_drawer"
        app:insetForeground="#4000"/&gt;

&lt;/android.support.v4.widget.DrawerLayout&gt;
</code></pre>

<p>I also set my style <strong>v21</strong> with this:</p>

<pre><code>&lt;style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"&gt;
    &lt;!-- Customize your theme here. --&gt;
    &lt;item name="colorPrimary"&gt;@color/colorPrimary&lt;/item&gt;
    &lt;item name="colorPrimaryDark"&gt;@color/colorPrimaryDark&lt;/item&gt;
    &lt;item name="colorAccent"&gt;@color/colorAccent&lt;/item&gt;
    &lt;item name="android:windowDrawsSystemBarBackgrounds"&gt;true&lt;/item&gt;
    &lt;item name="android:statusBarColor"&gt;@android:color/transparent&lt;/item&gt;
    &lt;item name="android:windowTranslucentStatus"&gt;true&lt;/item&gt;
    &lt;item name="windowActionModeOverlay"&gt;true&lt;/item&gt;
&lt;/style&gt;
</code></pre>

<p>But my problem is that the actionbar is always over my navigationdrawer, hiding his top side. here is a screenshot:</p>

<p><a href="https://i.stack.imgur.com/Doz5O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Doz5O.png" alt="enter image description here"></a></p>

<p>As you can see my actionbar is hiding the nav drawer.</p>

<p>How can I solve this? Any help will be appreciated.</p>

<p>Thanks all</p>

<p>PS:</p>

<p>this is what I want to achieve, it's the first image I found on the net.
<a href="https://i.stack.imgur.com/fJeBi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fJeBi.png" alt="enter image description here"></a></p>

<p>EDIT:
note the images please, my aim is not the same of the "duplicate". He wanted to set his List below an header, I want to hide the statusbar with my drawer</p>

<p>EDIT2:</p>

<p>I'm back to the origins, now the navigation drawer is simply below the actionBar. This is my java code:</p>

<pre><code>public class HomePageActivity extends AppCompatActivity implements IHomePage {

    private DrawerLayout drawerLayout;
    private NavigationView navigationView;
    private ActionBarDrawerToggle mDrawerToggle;
    private ActionBar ab;

    private boolean isDetail = false;
    private int lastSelected = 0;

    @Override
    protected void onResume() {
        super.onResume();

        if(mDrawerToggle != null) {
            mDrawerToggle.syncState();
        }

        if(navigationView != null){
            navigationView.getMenu().getItem(0).setChecked(true);
        } else{
            initDrawer();
            navigationView.getMenu().getItem(0).setChecked(true);
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home_page);

        navigationView = (NavigationView) findViewById(R.id.nav_view);
        drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);

        initActionBar() ;
        initDrawer();

        FragmentManager fragmentManager = getFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        PreferitiFragment fragment = new PreferitiFragment();
        fragmentTransaction.add(R.id.content_frame, fragment);
        fragmentTransaction.commit();

        mDrawerToggle.syncState();
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        mDrawerToggle.onConfigurationChanged(newConfig);
    }
    @Override
    public boolean onOptionsItemSelected(final MenuItem item) {
        return mDrawerToggle.onOptionsItemSelected(item) || super.onOptionsItemSelected(item);
    }
    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        mDrawerToggle.syncState();
    }

    private void initActionBar() {
        ab = getSupportActionBar();
        if (ab == null) {
            Toast.makeText(this, "no", Toast.LENGTH_SHORT).show();
            return;
        }
        ab.setDisplayHomeAsUpEnabled(true);
        ab.setHomeButtonEnabled(true);


    }

    private void initDrawer() {

        navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
            @Override
            public boolean onNavigationItemSelected(MenuItem item) {

                int id = item.getItemId();
                lastSelected = id;

                switch (id){
                    case R.id.nav_favorite:
                        setFragment(new PreferitiFragment());
                        break;

                    case R.id.nav_search:
                        setFragment(new CercaPaeseFragment());
                        break;

                    case R.id.nav_settings:
                        setFragment(new ImpostazioniFragment());
                        break;

                    case R.id.nav_guida:
                        setFragment(new GuidaFragment());
                        break;
                    default:
                        setFragment(new PreferitiFragment());
                        break;
                }

                DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
                drawer.closeDrawer(GravityCompat.START);
                return true;
            }
        });

        mDrawerToggle = new ActionBarDrawerToggle(
                this,
                drawerLayout,
                R.string.navigation_drawer_open,
                R.string.navigation_drawer_close
        ) {
            @Override
            public void onDrawerClosed(View drawerView) {
                super.onDrawerClosed(drawerView);

                invalidateOptionsMenu();
//                mDrawerToggle.syncState();
            }

            @Override
            public void onDrawerOpened(View drawerView) {
                super.onDrawerOpened(drawerView);
                invalidateOptionsMenu();
//                mDrawerToggle.syncState();
            }


        };
        drawerLayout.setDrawerListener(mDrawerToggle);
    }

    @Override
    public void showDetails(UUID idPharmacy) {

        isDetail = true;
        setFragment(new DettagliFragment());
    }

    @Override
    public void onBackPressed() {
        if (isDetail) {
            if(lastSelected == R.id.nav_search) {
                setFragment(new CercaPaeseFragment());
            } else if(lastSelected == R.id.nav_favorite){
                setFragment(new PreferitiFragment());
            }
        } else {
            super.onBackPressed();
        }
    }

    private void setFragment(Fragment fragment){


        IMyFragments iMyFragments = (IMyFragments) fragment;
        ab.setTitle(iMyFragments.getTitle());

        FragmentManager fragmentManager = getFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        fragmentTransaction.add(R.id.content_frame, fragment);
        fragmentTransaction.commit();
    }
}
</code></pre>

<p>And this is my home page layout:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:openDrawer="start"&gt;

    &lt;FrameLayout
        android:id="@+id/content_frame"
        android:layout_width="match_parent"
        android:background="#000000"
        android:layout_height="match_parent" &gt;
    &lt;/FrameLayout&gt;

    &lt;android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        app:headerLayout="@layout/nav_header_home_page"
        app:menu="@menu/activity_home_page_drawer" /&gt;

&lt;/android.support.v4.widget.DrawerLayout&gt;
</code></pre>