android-jetpack

Recreating backstack with Android Navigation Architecture Component

丶灬走出姿态 提交于 2020-08-22 05:12:43
问题 I am trying to implement navigation to specific Detail pages of my app using PendingIntent from a notification, however I am having problems recreating the backstack from the Detail page all the way back to the start destination. I made a sample app here with a single activity and three fragments to demo this: Fragment 1 -> Fragment 2 -> Fragment 3 (start dest) <- <- From Fragment 1 (the start destination), I navigate directly to Fragment 3 using Navigation.findNavController(this, R.id.nav

Recreating backstack with Android Navigation Architecture Component

假装没事ソ 提交于 2020-08-22 05:09:28
问题 I am trying to implement navigation to specific Detail pages of my app using PendingIntent from a notification, however I am having problems recreating the backstack from the Detail page all the way back to the start destination. I made a sample app here with a single activity and three fragments to demo this: Fragment 1 -> Fragment 2 -> Fragment 3 (start dest) <- <- From Fragment 1 (the start destination), I navigate directly to Fragment 3 using Navigation.findNavController(this, R.id.nav

Unable to refresh recyclerView with pagination

谁都会走 提交于 2020-08-10 12:25:25
问题 I have a RecyclerView that gets filled with paginated data. I need to be able to refresh it via SwipeRefreshLayout , but so far, I am unable to do so. I have tried plenty references that does similar to this, but without any success. Also, for letting you guys know, When I do refresh, the data gets retrieved correctly, but it is not being displayed on the recyclerView... Also, when I move from that destination to another via Navigation and then, I hit back, it gets updated. I am not sure what

Unable to refresh recyclerView with pagination

点点圈 提交于 2020-08-10 12:23:47
问题 I have a RecyclerView that gets filled with paginated data. I need to be able to refresh it via SwipeRefreshLayout , but so far, I am unable to do so. I have tried plenty references that does similar to this, but without any success. Also, for letting you guys know, When I do refresh, the data gets retrieved correctly, but it is not being displayed on the recyclerView... Also, when I move from that destination to another via Navigation and then, I hit back, it gets updated. I am not sure what

How to use NavigationExtensions.kt in a Java project?

萝らか妹 提交于 2020-08-08 19:03:42
问题 I'm trying to implement NavController with BottomNavigation in a new project. This is my first attempt and there is a lot of ambiguous information all over the place about this. So my question relates to each Bottom tab having its own back stack and persisting the fragments between bottom navigation taps. Yes, I have looked at https://github.com/android/architecture-components-samples/tree/master/NavigationAdvancedSample and I'm unable to understand how to integrate this with my existing Java

how to navigate one navigation graph to another in android jet pack navigation controller

你离开我真会死。 提交于 2020-08-07 09:23:10
问题 I have two navigation graph one for registration of my application after completing registration I want to navigate another graph is it possible? 回答1: You can use startActivity method to navigate to another navigation eg : activity?.startActivity(Intent(activity,HomeActivity::class.java)) in kotlin getActivity().startActivity((Intent(getActivity(),HomeActivity.class)) in java Note : HomeActivity contains nav host of another navigation graph 来源: https://stackoverflow.com/questions/52947581/how

How to interact with other fragment when using Navigation architecture component?

爷,独闯天下 提交于 2020-08-05 17:59:32
问题 i want to add fragment B on top of fragment A without view of fragment A getting destroyed. Only option i see in navigation library is to use navigate method to open a fragment but how to ensure fragment B is added on top of fragment A, not replaced. navigationController.navigate(R.id.B, bundle); and how to find the instance of fragment A to be able to interact with it? 回答1: Will like to know so as to clarify myself. Why don't you want fragment A be destroyed when you navigation to fragment B

How to interact with other fragment when using Navigation architecture component?

有些话、适合烂在心里 提交于 2020-08-05 17:58:45
问题 i want to add fragment B on top of fragment A without view of fragment A getting destroyed. Only option i see in navigation library is to use navigate method to open a fragment but how to ensure fragment B is added on top of fragment A, not replaced. navigationController.navigate(R.id.B, bundle); and how to find the instance of fragment A to be able to interact with it? 回答1: Will like to know so as to clarify myself. Why don't you want fragment A be destroyed when you navigation to fragment B

How to pass arguments to a fragment using bottom navigation view and Android Navigation component?

血红的双手。 提交于 2020-08-02 06:17:48
问题 Is it possible to pass and access arguments in a fragment using a bottom navigation view and the Navigation component? I'm using a one activity with many fragments approach where my top level fragment requires an argument(Usually done via the newInstance generated method). I've had a look at the Navigation component developer guide and the codelab but it only mentions using safeargs and adding argument tags in the destinations and actions. Here's my navigation graph: <navigation xmlns:app=

how to setup different toolbar using navigation controller component?

孤人 提交于 2020-08-01 16:45:59
问题 I am actually not sure, how the correct way or the best practice to set different toolbar using navigation controller component in my app. I want to set 2 different toolbars. green toolbar red toolbar two toolbars with different colour. this is just to simplify the case, actually I have multiple toolbars I am using navigation controller component. and currently on my Main Activity as the host, I set the green toolbar in my main activity using this code setSupportActionBar(green_toolbar)