navigation-drawer

Navigation Drawer doesn't work onBackPressed in different Activities

狂风中的少年 提交于 2019-12-24 07:31:11
问题 I am using common navigation drawer for different activities where I am extending BaseActivity , although it works fine but i am unable to open the drawer if I pressed back button to go to the previous activity. This is my code: public class BaseActivity extends ActionBarActivity { public static DrawerLayout mDrawerLayout; public static ListView mDrawerList; private ActionBarDrawerToggle mDrawerToggle; protected RelativeLayout _completeLayout, _activityLayout; // nav drawer title private

Unknown error while using DrawerLayout?

元气小坏坏 提交于 2019-12-24 06:58:53
问题 I am trying to use DrawerLayout from Support library using official tutorial but whenever I tried to run my application I got crash .After reading the below logs I am not able to identify the location in my code which is responsible for this crash. 06-16 21:14:55.272: E/AndroidRuntime(20104): FATAL EXCEPTION: main 06-16 21:14:55.272: E/AndroidRuntime(20104): android.view.InflateException: Binary XML file line #17: Error inflating class <unknown> 06-16 21:14:55.272: E/AndroidRuntime(20104): at

Android: Navigation Component not working with both: <navigation> and NavigationItemSelectedListener

安稳与你 提交于 2019-12-24 06:34:55
问题 What I have done: I have created Navigation Drawer Activity , As updated new format of Navigation Drawer Activity , As per new Android architecture I got it with Navigation Component structure. The NavigationView code with NavController and NavigationUI as below which is opening fragment when I click on any navigation item. DrawerLayout drawer = findViewById(R.id.drawer_layout); NavigationView navigationView = findViewById(R.id.nav_view); // Passing each menu ID as a set of Ids because each /

Android build mini navigation drawer with Icons

夙愿已清 提交于 2019-12-24 06:05:23
问题 I want to build a fixed mini nav drawer in android. will will always be visible an not extendable, with icons only. Something like https://github.com/mikepenz/MaterialDrawer Mini Drawer. I try used his library, but I can't figured out how to make it fixed. here is my code: private Drawer result = null; private MiniDrawer miniResult = null; result = new DrawerBuilder() .withActivity(this) .withToolbar(toolbar) .withTranslucentStatusBar(false) .addDrawerItems( new PrimaryDrawerItem().withName(

Navigation Drawer + ViewPager + Fragments, ViewPager doesn't destroy nested fragments

情到浓时终转凉″ 提交于 2019-12-24 03:43:38
问题 My app has Navigation Drawer with two items: a ViewPager (inside a Fragment) and SupportMapFragment. ViewPager use a FragmentStatePagerAdapter and getItem(int position) return two Fragments. When I open navigation drawer and I select " item 1 " (SupportMapFragment), the other Fragment (ViewPager is inside of this) execute onDestroy() method but this method doesn't destroy the Fragments created by the adapter so when I select " item 0 " again , my app create the ViewPager with its two items

How to add Tabhost in Navigation Drawer

ぐ巨炮叔叔 提交于 2019-12-24 03:07:22
问题 In my app I am using navigation drawer from this tutorial http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/ Now I am trying to add tabhost with fragment,but its not working it shows error here tabss.setViewPager(mViewPager); Cannot resolve method setviewpager(android.support.v4.view.viewpager) public class All_Product_Details extends Fragment { private TabHost mTabHost; private ViewPager mViewPager; private YourAdapter mTabsAdapter; private Button descr;

Double Toolbar Is Showing on Fragment

浪子不回头ぞ 提交于 2019-12-24 00:42:41
问题 Hello Guys, My problem is related to double toolbar is coming in my app while inflating(or say replacing) a fragment. I have an activity class which contains navigation drawer with it's toolbar with navigation toolbar icon. There is some fragment i don't want to show the activity toolbar i need to show only fragment toolbar : But while replacing it's showing activity as well as fragment toolbar , any suggestion helpful to me. I have given the try : My Fragment : public class

Set up side drawer controller

我怕爱的太早我们不能终老 提交于 2019-12-23 16:15:46
问题 basically i use MMDrawerviewController for side drawer and my setup for storyboard prototype is like below and my code is as successful login is UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; MenuVC *menuViewController = [storyboard instantiateViewControllerWithIdentifier:@"MenuVC"]; UIViewController *centerViewController = [storyboard instantiateViewControllerWithIdentifier:@"VC1"]; MMDrawerController *drawer = [[MMDrawerController alloc]

Darken/Dim/Blur Activity when navigation drawer is open

风格不统一 提交于 2019-12-23 15:55:32
问题 I am using LDrawer in my project. I need to make the activity which is hosting the navigation drawer darken/dim/blur when the navigation drawer is opened. I have gone through similar questions on Stackoverflow and I have not found a satisfiying answer. Is there any simple trick to make the activity's layout darken/dim/blur when I open my NavigationDrawer I have the RelativeLayout of my activity defined as RelativeLayout myActivity = (RelativeLayout) findViewById(R.id.myActivity) I have the

how to create an expandable listView inside navigation drawer?

。_饼干妹妹 提交于 2019-12-23 12:15:34
问题 I need to create a navigation drawer like flipkart or Astro file manager app. How can I replace a listView with an expandable listView? I need an navigation Drawer like this: This is my xml : <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" tools:context=".MainActivity"