title: DrawerToggle may not show up because NavigationIcon is not visible
body: <p>ERROR: </p>
  
  <blockquote>
    <p><code>DrawerToggle</code> may not show up because NavigationIcon is not visible.
    You may need to call <code>actionbar.setDisplayHomeAsUpEnabled(true);</code></p>
  </blockquote>
  
  <pre><code>    public class Homepage extends AppCompatActivity  implements NavigationView.OnNavigationItemSelectedListener {
  
      int storeid;
      String storename;
      private RecyclerView recyclerView;
      ProductAdapter adapter;
      private RecyclerView.LayoutManager layoutManager;
      ArrayList&lt;ProductClass&gt; Products = new ArrayList&lt;&gt;();
      Database database;
      public DrawerLayout mDrawerLayout;
      public ActionBarDrawerToggle mDrawerToggle;
      ActionBar actionBar;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.homepage);
  
          Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar1);
          setSupportActionBar(toolbar);
          database = new Database();
  
          mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
          mDrawerToggle = new ActionBarDrawerToggle(
                  this, mDrawerLayout,toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
  
          assert mDrawerLayout != null;
          mDrawerLayout.addDrawerListener(mDrawerToggle);
          mDrawerToggle.syncState();
  
          NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
          navigationView.setNavigationItemSelectedListener(Homepage.this);
  
  
          load();
  
          View hView =  navigationView.getHeaderView(0);
          TextView nav_name = (TextView)hView.findViewById(R.id.textView);
          nav_name.setText(storename);
  
          Products = database.getstoreproducts(storeid);
  
          if (Products == null)
              Toast.makeText(Homepage.this, "Store is empty", Toast.LENGTH_LONG).show();
          else {
  
              recyclerView = (RecyclerView) findViewById(R.id.my_recycler_view);
              recyclerView.setHasFixedSize(true);
              layoutManager = new LinearLayoutManager(this);
              recyclerView.setLayoutManager(layoutManager);
              adapter = new ProductAdapter(Products, Homepage.this);
              recyclerView.setAdapter(adapter);
  
          }
      }
  
      @Override
      protected void onPostCreate(Bundle savedInstanceState) {
          super.onPostCreate(savedInstanceState);
          // Sync the toggle state after onRestoreInstanceState has occurred.
          mDrawerToggle.syncState();
      }
  
      @Override
      public void onConfigurationChanged(Configuration newConfig) {
          super.onConfigurationChanged(newConfig);
          mDrawerToggle.onConfigurationChanged(newConfig);
      }
  
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
  
          //noinspection SimplifiableIfStatement
          if (id == R.id.action_settings) {
              return true;
          }
  
          return super.onOptionsItemSelected(item);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          MenuInflater m = getMenuInflater();
          return true;
      }
  
      public void load() {
  
          SharedPreferences sharedPreferences = getSharedPreferences("MyStore", Context.MODE_PRIVATE);
          storename = sharedPreferences.getString("storename", "Default");
          storeid = sharedPreferences.getInt("storeid", -1);
  
      }
  
  
      @Override
      public void onBackPressed() {
          DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
          if (drawer.isDrawerOpen(GravityCompat.START)) {
              drawer.closeDrawer(GravityCompat.START);
          } else {
              super.onBackPressed();
          }
      }
  
      @SuppressWarnings("StatementWithEmptyBody")
      @Override
      public boolean onNavigationItemSelected(MenuItem item) {
          // Handle navigation view item clicks here.
          int id = item.getItemId();
  
          if (id == R.id.nav_home) {
  
              DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
              if (drawer.isDrawerOpen(GravityCompat.START)) {
                  drawer.closeDrawer(GravityCompat.START);
              }
  
              // Handle the camera action
          } else if (id == R.id.nav_add) {
  
              Intent intent = new Intent(Homepage.this, addnewproduct.class);
              startActivity(intent);
  
          }
  
          else if (id == R.id.nav_user) {
  
              Intent intent = new Intent(Homepage.this, storeinfo.class);
              startActivity(intent);
  
          }
  
          else if (id == R.id.nav_logout) {
  
              SharedPreferences sharedPreferences = getSharedPreferences("MyStore", Context.MODE_PRIVATE);
              SharedPreferences.Editor editor=sharedPreferences.edit();
              editor.putString("logged", "unsuccessful");
              editor.commit();
              Intent intent = new Intent(Homepage.this, MainActivity.class);
              startActivity(intent);
  
          }
  
          DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
          drawer.closeDrawer(GravityCompat.START);
  
          return true;
      }
  
  }
  </code></pre>
  
  <p>T tried everything i found but couldn't find any solution. please help.</p>