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
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
add a comment |
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
add a comment |
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
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
android android-layout
edited Mar 6 at 17:06
Abdessamad Ben
asked Mar 6 at 16:27
Abdessamad BenAbdessamad Ben
23
23
add a comment |
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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