drawerlayout

CoordinatorLayout NullPointerException in onTouchEvent

烈酒焚心 提交于 2019-12-12 08:39:33
问题 I am getting NullPointerException in onTouchEvent of CoordinatorLayout . I am using DrawerLayout with CollapsingToolbarLayout of android support AppCompat v23.0.0 library. My observation is crash happen randomly while scrolling CollapsingToolbarLayout or click on drawer items. Is there anyone facing this issue? any work around to avoid this exception? Logcat: 08-22 15:16:34.657: E/AndroidRuntime(27596): java.lang.NullPointerException: Attempt to invoke virtual method 'float android.view

Create a Nested Fragment

走远了吗. 提交于 2019-12-12 04:04:47
问题 I have MainLayout which contains multiple instances of DrawerLayout, each Drawerlayout has 3 items and every item has a fragment. When I click on an item its fragment displays on MainLayout by FragmentTransaction. public boolean onNavigationItemSelected(MenuItem item) { // Handle navigation view item clicks here. int id = item.getItemId(); if (id == R.id.home) { FragmentTransaction transaction = manager.beginTransaction(); Hello f1 = new Hello(); transaction.replace(R.id.main_layout,f1,"home"

Android Activity using navigation view in full screen mode shows at the bottom a grey translucent area

不想你离开。 提交于 2019-12-12 03:02:28
问题 I have an activity which is using the following method to enable fullscreen mode. protected void hideSystemUI() { View decorView = getWindow().getDecorView(); decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); } In this activity I am also using the NavigationView and when the

Get selected radio button id placed in navigation view

别来无恙 提交于 2019-12-12 01:43:57
问题 I have taken radio group in the navigation view of drawer layout like this <android.support.design.widget.NavigationView app:headerLayout="@layout/header" app:menu="@menu/drawer"> <RadioGroup> <RadioButton/> <RadioButton/> </RadioGroup> </android.support.design.widget.NavigationView> I want to get the selected radio button text or id but I am not getting any logs or Toast and no errors also.. Code for getting selected radio button: rg.setOnCheckedChangeListener(new RadioGroup

Why Do see two toolbars when I created an app that has a navigation drawer?

故事扮演 提交于 2019-12-11 07:05:50
问题 I have created an app that has a navigation drawer, it works fine, but the only problem is that I see two toolbars. One in which there is Actionbartoggle button and other which is default. Now the tutorial I have seen has used a toolbar in the main content of drawer layout and obviously navigation contents are coming from menu. Now the problem is I think we have to pass a toolbar reference in the constructor of Actionbardrawertoggle, and after I passed it properly it works fine, but I see two

How to add 3 lines icon in left top corner Android DrawerLayout

泄露秘密 提交于 2019-12-11 07:02:14
问题 I'am writing new app and I want to change my drawerLayout icon look to typical 3 horizontal lines. If I click on it, Icon should change his look to arrow. Now I have an arrow icon all the time. package pl.nieruchalski.scrumfamily; import android.app.Activity; import android.content.res.Configuration; import android.os.PersistableBundle; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.os.Bundle; import android.view.MenuItem;

Navigation Drawer covers Actionbar

[亡魂溺海] 提交于 2019-12-11 06:20:00
问题 I wanted Navigation Drawer in my application but I don't want Navigation Drawer to covers my Action Bar . Action bar should be visible always. I searched internet and i got some solution from stackoverflow and some blogs but all are same. I referred this solution Using Navigation Drawer without TitleBar or ActionBar, but still its same. As they mentioned in the answer, i gave android.support.v7.widget.Toolbar first then android.support.design.widget.NavigationView . Android studio design

Using a DrawerLayout along with a ListView

醉酒当歌 提交于 2019-12-11 05:47:01
问题 I'm trying to write an android app with a listview of a few different items and also a drawerlayout that you can drag from the left side of the screen. Here's what i mean.... This is what the main screen looks like: And here's what the drawer menu thing looks like: The problem i'm having is that when I open the side drawer menu thing and tap an option it doesn't work and the menu just closes. However i'm able to interact with the main listview page. Here's what my code looks like: String[]

Android DrawerLayout with MapFragment black screen when returning to map

喜欢而已 提交于 2019-12-11 01:04:04
问题 I've been experimenting with android.support.v4.widget.DrawerLayout and have 4 fragments to choose from the drawer. The map initially loads with no problems however when I open the drawer and change fragments I am unable to then go back to the map. I just get a black screen. Logcat is showing the fragment is re-created but yet I get nothing. Just a blank black screen. I can switch between the other fragments with no problem. What am I doing wrong? My project has a Min API of 14. I load the

Incompatible types: Fragment cannot be converted to NavigationDrawerFragment

痴心易碎 提交于 2019-12-10 14:54:44
问题 I've been working on an app using API 14, but I had to downgrade to API 10. the app has fragments and activity fragments, I have imported the libraries and used the getFragmentSupportManager because it is v4. However, I have following error: I created a dummy app with Drawer layout and fragments with API 10 from the beginning, it had the same line in MyActivity file and it was not an error. Here is my code: package az.test2; import android.app.Activity; import android.os.Bundle; import