FAQ Database Discussion Community


Why is my DrawerLayout still open on activity resume, in spite of closing it?

android,monodroid,android-navigation
I have a DrawerLayout which contains a ListView of items that link to other Activities. The OnItemClick event of the ListView is a switch-case for each menu element, which runs the code ... case targetActivity: listViewInstance.ClearChoices(); drawerInstance.CloseDrawer(MainMenuLayout); drawerInstance.RequestLayout(); StartActivity(targetIntent); break; ... This works mostly as expected, but if I change...

Fragment not showing

android,android-fragments,navigation-drawer,android-fragmentactivity,android-navigation
So I've been basing my navigation drawer after code i found in a tutorial. However my fragments don't switch. Laptop is down and using AIDE. Anyone tell me what's wrong? Guessing it's my setonitemclicklistener. { private ListView mDrawerList; private DrawerLayout mDrawerLayout; private ArrayAdapter<String> mAdapter; private ActionBarDrawerToggle mDrawerToggle; private String mActivityTitle;...

Back button takes me to launcher activity not deep-linker activity

android,android-activity,deep-linking,android-navigation,activity-stack
Following procedure: Start my application, Stack: [HomeActivity] Going to Facebook, using a deep link to get into Activity X Pressing back button results in getting back to HomeActivity instead of Facebook Expected Start my application, Stack: [HomeActivity] Going to Facebook, using a deep link to get into Activity X Pressing...

Tool bar setNavigationOnClickListener breaks ActionbarDrawerToggle functionality

android,android-toolbar,android-navigation
I'm swapping out the action bar for the tool bar, and I nearly have every piece of the puzzle in place. My issue is specifically if I navigate 'up' and restore the navigation drawer, the drawer toggle button no longer works. I figured out if I set the drawer mode...

Detect soft navigation bar availability in android device progmatically?

android,android-layout,android-ui,android-navigation
I am trying to determine soft navigation bar through the android program. I didn't find straight way to determine. Is there anyway to find the navigation bar availability. Soft Navigation bar image is here. ...

Whether or not to use multiple instances of an Activity on Android?

android,android-activity,android-listview,android-navigation
If I have an app that refills a ListView with different data in response to a user selecting an item. Should I start a new Activity or just change the data, and call Adapter.notifyDataSetChanged()? It seems like calling notifyDataSetChanged() is simpler, and would minimize my potential number of activities (and...

Master/detail flow or navigation drawer ? which is better for display detail data about list items?

android,design-patterns,user-experience,android-navigation
I have a list of persons that when user click on one item the app show its detail ! i used dual pane Master/detail design pattern for tablet size and for small size it just replace list with detail fragment. The problem is that my manager think its better to...

Navigation drawer + ViewPager - fragments do not show

android,android-fragments,android-viewpager,android-navigation
I have a problem with the layout I created. I used the Navigation Drawer as a main navigation pattern. It looks and works as I wanted, but the problem is that after returning to the fragment which holds ViewPager - the inner-fragments are not shown. However, they are shown when...

android.support.v7 Toolbar & DrawerLayout- how to change Hamburger icon

android,android-actionbar,android-toolbar,android-navigation,android-icons
My application uses ActionBarActivity and DrawerLayout and etc. i want to change the ActionBarDrawerToggle icon to be custom drawable. in my code i use android.support.v7.widget.Toolbar as SupportActionBar this is my code: toolbar.setNavigationIcon(R.drawable.lifeline_shield); setSupportActionBar(toolbar); ActionBar actionbar = getSupportActionBar(); actionbar.setDisplayHomeAsUpEnabled(true); actionbar.setDisplayShowTitleEnabled(false); mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, toolbar, R.string.somestring1,...

how to call RecyclerView in the first fragment of the navigation drawer? I've followed a tutorial by slidenerd but getting one error

android,android-fragments,android-navigation,android-recyclerview
This is the Java file of the fragment I wish to insert recycler view. Please dont worry about the package name which I deleted for some reasons. import android.app.Activity; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import java.util.ArrayList; import java.util.List; public class Dashboard...

Android - Navigation Up from Activity to Fragment

android,android-fragments,android-activity,android-navigation,android-savedstate
I'm developing some application and I have one problem. I have : 1. Activity A (Navigation Drawer pattern) with ListFragment in FrameLayout: xml: <FrameLayout ...> </FrameLayout> <LinearLayout ...> </LinearLayout> </android.support.v4.widget.DrawerLayout> Activity B which shows the detail data of ListView in ListFragment. How can I go back (using Navigation Up Button)...

Use UP caret in ActionBar to go from Activity to Fragment - Android 4.0+

android,android-fragments,android-actionbar,android-navigation
I've been researching all day/night for a solution, but it seems there are lots of options to go from an Activity to a Fragment, but none are working for me on S.O. In practice, I am in an Activity, and I want to use my app logo in the ActionBar...

Navigation drawer won't close when item selected

android,android-fragments,enums,android-navigation
I have a navigation drawer that when an Item is selected, it loads the new fragment but never closes the drawer. My navigation drawer code looks like this: import android.IntentIntegrator; import android.IntentResult; import android.annotation.TargetApi; import android.app.SearchManager; import android.content.Context; import android.content.Intent; import android.content.res.Configuration; import android.os.Build; import android.os.Bundle; import android.support.v4.app.ActionBarDrawerToggle; import android.support.v4.app.Fragment;...

App crashing on some random devices

android,android-fragments,android-listview,android-adapter,android-navigation
Today I encountered a Strange Problem in my app. SO in first activity, there is a navigation drawer with some items listed in listview (in drawer).there is scrollbar in navigation drawer. now, on some random devices Problems occurs. App is launching correctly but as soon as I scroll ( Inside...