Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
339 views
in Technique[技术] by (71.8m points)

android - Kotlin navigation drawer activity route parameter

I have started a Kotlin project using navigation drawer activity from Anroid studio template https://github.com/TVart/NavDrawerActivity As you can see there a 3 sub menu or routes (Home, Galaxy & Slideshow) What I want is to route all these 3 routes to the same (unique) Fragment, and passing a custom parameter for each route, where I will load data from db according to this passed parameter

enter image description here

question from:https://stackoverflow.com/questions/65945774/kotlin-navigation-drawer-activity-route-parameter

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Each time when you click, a variable could be added in the activity (or wherever you want), when the Fragment is called, could check previously this value in the activity from the fragment each time it loads.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...