android-navigation

Android Jetpack Navigation, BottomNavigationView with Youtube or Instagram like proper back navigation (fragment back stack)?

走远了吗. 提交于 2019-12-29 10:07:20
问题 Android Jetpack Navigation, BottomNavigationView with auto fragment back stack on back button click? What I wanted, after choosing multiple tabs one after another by user and user click on back button app must redirect to the last page he/she opened. I achieved the same using Android ViewPager, by saving the currently selected item in an ArrayList. Is there any auto back stack after Android Jetpack Navigation Release? I want to achieve it using navigation graph activity_main.xml <?xml version

How to detect soft menu key available in android device?

吃可爱长大的小学妹 提交于 2019-12-25 17:43:04
问题 I would like to check menu key presence in the device in android application. To achieve that i used following code to detect weather device is having hardware menu or not and it is working fine !ViewConfiguration.get(ScsCommander.getInstance().getApplicationContext()).hasPermanentMenuKey() But i did not find a logic to find weather the device is having soft menu present or not. Please suggest me is there any way to detect soft menu is available or not in the device. 回答1: There is no reliable

Android: Task affinity & Clear task

泪湿孤枕 提交于 2019-12-24 13:22:27
问题 I am having three modules - ModuleA, ModuleB, ModuleC ModuleA - 1 activity MainActivity - no task affinity Module B - 3 activities Activity_A task affinity = "com.performance.poc.main" Activity_B task affinity = "com.performance.poc.main" Activity_C task affinity = "com.performance.poc.main" Module C - 1 activity Activity_D - no task affinity Navigation Case 1: MainActivity on btn Click - start Activity_A Intent.FLAG_ACTIVITY_NEW_TASK on btn Click - start Activity_B on btn Click - start

How to perform custom navigation?

我们两清 提交于 2019-12-24 12:13:15
问题 I try to using new architecture component called navigation. It's very thrilling and make lesser code than using FragmentManager . Now, I ended up in a case where I have 5 fragments with navigation looks like this: A -> B -> C -> D -> E Sometime I have to move user from fragment A directly to E and if back button pressed, I want something like this: E -> D -> C -> B -> A But what I got now is: E -> A Is there any approachable way to make it happen? 回答1: OK! if you want to go from E -> A then

Navigation drawer 2.3 gingerbread

风流意气都作罢 提交于 2019-12-23 02:43:20
问题 I am trying to implement navigation drawer in my android app. I used This tutorial : http://manishkpr.webheavens.com/android-navigation-drawer-example-using-fragments/ which shows to implement the navigation drawer with the use of fragments. But my app force closes as I am trying to run it on API 10 (Gingerbread) But it works only on 3.0 Honeycomb+. How do I make it work on 2.3 Gingerbread+ and in fullscreen mode. Please I need help! Thanks in advance! StackTrace 01-09 16:01:07.971 16470

Is navigation in iosched 13 application correct?

☆樱花仙子☆ 提交于 2019-12-22 07:27:08
问题 Navigation with Up and Back buttons is quite complicated (at least for me) As the android documentation states, You have the ability to make the Up behavior even smarter based on your knowledge of detail view. Extending the Play Store example from above, imagine the user has navigated from the last Book viewed to the details for the Movie adaptation. In that case, Up can return to a container (Movies) which the user hasn't previously navigated through. http://developer.android.com/design

Navigation drawer doesn't close

蓝咒 提交于 2019-12-20 20:30:51
问题 The navigation drawer in my app is not closing. I am using activities instead of fragments. When i click on any item in the listview , it opens other activities as it should but when i go back, the drawer is still open. I have tried using DrawerLayout.closeDrawers(); but it did not work. How do I close the navigation drawer? Here is my code: Java public class MainActivity extends FragmentActivity { final String[] data ={"Aluminium","Gold","Zinc"}; @Override protected void onCreate(Bundle

OnClick for navigationDrawer not loading new fragments

ⅰ亾dé卋堺 提交于 2019-12-20 05:17:06
问题 I have been trying to create a navigationDrawer for my project. I have been following this review here: http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/ I have been editing the code a bit, to use my own layout, in order to take out the icons and notifications in the navigation drawer. I just needed a simple one. I have the drawer mostly working except for the onCLicks. I am not getting any errors, but when I click an item in my NavDrawer it does not load the

How to Have Navigation Drawer setup with Navigation Controller and handle individual Menu Items

余生颓废 提交于 2019-12-19 10:19:12
问题 I would like to have most of menu item handled by Navigation Component's controller, but I also want to handle one "Log out" menu item individually like this: val navController = findNavController(R.id.nav_host_fragment) nav_view.setNavigationItemSelectedListener { item -> when(item.itemId) { R.id.logout_menu_item -> { Toast.makeText(context, "Logut Menu Item Touched", Toast.LENGTH_LONG).show() true } else -> false } } nav_view.setupWithNavController(navController) bottom_navigation

Android Navigation Component pop to transition issue

懵懂的女人 提交于 2019-12-18 11:53:26
问题 I have 2 actions Action1 <action android:id="@+id/actionBaseFragmentToAskForLocation" app:destination="@+id/introAskForLocationFragment" app:enterAnim="@anim/slide_in_right" app:exitAnim="@anim/slide_out_left" app:popEnterAnim="@anim/slide_in_left" app:popExitAnim="@anim/slide_out_right" /> Action2 <action android:id="@+id/actionIntroAskLocationToLogin" app:destination="@id/loginFragment" app:enterAnim="@anim/slide_in_right" app:exitAnim="@anim/slide_out_left" app:popEnterAnim="@anim/slide_in