Navigation Drawer not showing after clicking2019 Community Moderator Election'Must Override a Superclass Method' Errors after importing a project into EclipseDownload a file with Android, and showing the progress in a ProgressDialogAndroid - tiled backgrounds occasionally get stretchedHow do I play an audio file in Android?Navigation Drawer (Google+ vs. YouTube)Android - Google Maps API v2 - NoClassDefFoundErrorAppcompatv7 - v21 Navigation drawer not showing hamburger iconOverdraw on separatorAndroid Studio Layout ErrorsOnClickListener not working with fragments

"One can do his homework in the library"

What does a stand alone "T" index value do?

Why would a jet engine that runs at temps excess of 2000°C burn when it crashes?

Can't find the Shader/UVs tab

Should QA ask requirements to developers?

Finding algorithms of QGIS commands?

Best approach to update all entries in a list that is paginated?

Make a transparent 448*448 image

Upside Down Word Puzzle

Unreachable code, but reachable with exception

Is there an equal sign with wider gap?

Time travel short story where dinosaur doesn't taste like chicken

Why is there a voltage between the mains ground and my radiator?

Can you reject a postdoc offer after the PI has paid a large sum for flights/accommodation for your visit?

How did Alan Turing break the enigma code using the hint given by the lady in the bar?

What to do when during a meeting client people start to fight (even physically) with each others?

How to create a hard link to an inode (ext4)?

Are the terms "stab" and "staccato" synonyms?

2×2×2 rubik's cube corner is twisted!

Making a sword in the stone, in a medieval world without magic

In the late 1940’s to early 1950’s what technology was available that could melt a LOT of ice?

What wound would be of little consequence to a biped but terrible for a quadruped?

Do items de-spawn in Diablo?

Is there any way to damage Intellect Devourer(s) when already within a creature's skull?



Navigation Drawer not showing after clicking



2019 Community Moderator Election'Must Override a Superclass Method' Errors after importing a project into EclipseDownload a file with Android, and showing the progress in a ProgressDialogAndroid - tiled backgrounds occasionally get stretchedHow do I play an audio file in Android?Navigation Drawer (Google+ vs. YouTube)Android - Google Maps API v2 - NoClassDefFoundErrorAppcompatv7 - v21 Navigation drawer not showing hamburger iconOverdraw on separatorAndroid Studio Layout ErrorsOnClickListener not working with fragments










0















i have a problem on one of my activities the drawer is not showing when i'm clicking on the icon but when i swipe it's shown normally
i tried to toast a message when the icon is clicked but got nothing
the problem is other activities are working just fine with the same code i have a problem only with this one



 protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

drawer = findViewById(R.id.drawer_layout);


toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
toggle.setToolbarNavigationClickListener(new View.OnClickListener()
@Override
public void onClick(View view)
drawer.openDrawer(GravityCompat.START);

);
toggle.setHomeAsUpIndicator(R.mipmap.nav);
drawer.addDrawerListener(toggle);
toggle.syncState();

toggle.setDrawerIndicatorEnabled(false);


navigationView = findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);


and this is the layout file



 <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">



<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="80dp" />


and this is the app_bar_main layout



<android.support.design.widget.CoordinatorLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.vpapps.hdwallpaper.MainActivity">

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="0dp"
android:theme="@style/AppTheme.AppBarOverlay"
tools:targetApi="lollipop">

<com.vpapps.utils.StatusBarView
android:id="@+id/statusBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"/>

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimaryDark"
app:popupTheme="@style/AppTheme.PopupOverlay"
android:elevation="0dp"
tools:targetApi="lollipop" />

</android.support.design.widget.AppBarLayout>

<include layout="@layout/content_main_walpaper" />

</android.support.design.widget.CoordinatorLayout>


i tried many things but still same problem
thanks










share|improve this question




























    0















    i have a problem on one of my activities the drawer is not showing when i'm clicking on the icon but when i swipe it's shown normally
    i tried to toast a message when the icon is clicked but got nothing
    the problem is other activities are working just fine with the same code i have a problem only with this one



     protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    drawer = findViewById(R.id.drawer_layout);


    toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
    this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
    toggle.setToolbarNavigationClickListener(new View.OnClickListener()
    @Override
    public void onClick(View view)
    drawer.openDrawer(GravityCompat.START);

    );
    toggle.setHomeAsUpIndicator(R.mipmap.nav);
    drawer.addDrawerListener(toggle);
    toggle.syncState();

    toggle.setDrawerIndicatorEnabled(false);


    navigationView = findViewById(R.id.nav_view);
    navigationView.setNavigationItemSelectedListener(this);


    and this is the layout file



     <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">



    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <include
    layout="@layout/app_bar_main"
    android:layout_width="match_parent"
    android:layout_height="80dp" />


    and this is the app_bar_main layout



    <android.support.design.widget.CoordinatorLayout 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:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.vpapps.hdwallpaper.MainActivity">

    <android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:elevation="0dp"
    android:theme="@style/AppTheme.AppBarOverlay"
    tools:targetApi="lollipop">

    <com.vpapps.utils.StatusBarView
    android:id="@+id/statusBar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/colorPrimary"/>

    <android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="@color/colorPrimaryDark"
    app:popupTheme="@style/AppTheme.PopupOverlay"
    android:elevation="0dp"
    tools:targetApi="lollipop" />

    </android.support.design.widget.AppBarLayout>

    <include layout="@layout/content_main_walpaper" />

    </android.support.design.widget.CoordinatorLayout>


    i tried many things but still same problem
    thanks










    share|improve this question


























      0












      0








      0








      i have a problem on one of my activities the drawer is not showing when i'm clicking on the icon but when i swipe it's shown normally
      i tried to toast a message when the icon is clicked but got nothing
      the problem is other activities are working just fine with the same code i have a problem only with this one



       protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);

      drawer = findViewById(R.id.drawer_layout);


      toolbar = findViewById(R.id.toolbar);
      setSupportActionBar(toolbar);

      ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
      this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
      toggle.setToolbarNavigationClickListener(new View.OnClickListener()
      @Override
      public void onClick(View view)
      drawer.openDrawer(GravityCompat.START);

      );
      toggle.setHomeAsUpIndicator(R.mipmap.nav);
      drawer.addDrawerListener(toggle);
      toggle.syncState();

      toggle.setDrawerIndicatorEnabled(false);


      navigationView = findViewById(R.id.nav_view);
      navigationView.setNavigationItemSelectedListener(this);


      and this is the layout file



       <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">



      <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical">

      <include
      layout="@layout/app_bar_main"
      android:layout_width="match_parent"
      android:layout_height="80dp" />


      and this is the app_bar_main layout



      <android.support.design.widget.CoordinatorLayout 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:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.vpapps.hdwallpaper.MainActivity">

      <android.support.design.widget.AppBarLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:elevation="0dp"
      android:theme="@style/AppTheme.AppBarOverlay"
      tools:targetApi="lollipop">

      <com.vpapps.utils.StatusBarView
      android:id="@+id/statusBar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@color/colorPrimary"/>

      <android.support.v7.widget.Toolbar
      android:id="@+id/toolbar"
      android:layout_width="match_parent"
      android:layout_height="?attr/actionBarSize"
      android:background="@color/colorPrimaryDark"
      app:popupTheme="@style/AppTheme.PopupOverlay"
      android:elevation="0dp"
      tools:targetApi="lollipop" />

      </android.support.design.widget.AppBarLayout>

      <include layout="@layout/content_main_walpaper" />

      </android.support.design.widget.CoordinatorLayout>


      i tried many things but still same problem
      thanks










      share|improve this question
















      i have a problem on one of my activities the drawer is not showing when i'm clicking on the icon but when i swipe it's shown normally
      i tried to toast a message when the icon is clicked but got nothing
      the problem is other activities are working just fine with the same code i have a problem only with this one



       protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);

      drawer = findViewById(R.id.drawer_layout);


      toolbar = findViewById(R.id.toolbar);
      setSupportActionBar(toolbar);

      ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
      this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
      toggle.setToolbarNavigationClickListener(new View.OnClickListener()
      @Override
      public void onClick(View view)
      drawer.openDrawer(GravityCompat.START);

      );
      toggle.setHomeAsUpIndicator(R.mipmap.nav);
      drawer.addDrawerListener(toggle);
      toggle.syncState();

      toggle.setDrawerIndicatorEnabled(false);


      navigationView = findViewById(R.id.nav_view);
      navigationView.setNavigationItemSelectedListener(this);


      and this is the layout file



       <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">



      <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical">

      <include
      layout="@layout/app_bar_main"
      android:layout_width="match_parent"
      android:layout_height="80dp" />


      and this is the app_bar_main layout



      <android.support.design.widget.CoordinatorLayout 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:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.vpapps.hdwallpaper.MainActivity">

      <android.support.design.widget.AppBarLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:elevation="0dp"
      android:theme="@style/AppTheme.AppBarOverlay"
      tools:targetApi="lollipop">

      <com.vpapps.utils.StatusBarView
      android:id="@+id/statusBar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@color/colorPrimary"/>

      <android.support.v7.widget.Toolbar
      android:id="@+id/toolbar"
      android:layout_width="match_parent"
      android:layout_height="?attr/actionBarSize"
      android:background="@color/colorPrimaryDark"
      app:popupTheme="@style/AppTheme.PopupOverlay"
      android:elevation="0dp"
      tools:targetApi="lollipop" />

      </android.support.design.widget.AppBarLayout>

      <include layout="@layout/content_main_walpaper" />

      </android.support.design.widget.CoordinatorLayout>


      i tried many things but still same problem
      thanks







      android android-layout






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 6 at 17:06







      Abdessamad Ben

















      asked Mar 6 at 16:27









      Abdessamad BenAbdessamad Ben

      23




      23






















          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55027869%2fnavigation-drawer-not-showing-after-clicking%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55027869%2fnavigation-drawer-not-showing-after-clicking%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

          Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

          Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved