简体   繁体   中英

activity or fragment? help me out to choose

There are 3 similar screens in my app. So doubt is what should I create for these screens Activity or Fragment. 登录屏幕弹出 注册屏幕弹出窗口 忘记密码弹出窗口

As per the given UI, Fragments would be the best option. I would suggest you, use the Navigation component for the fragment navigation.

You can visit the documentation of Navigation Component by Jetpack: Navigation component Guide

Happy Coding :)

Use fragments for this scenario, because fragments gives the freedom to reuse the components and also maintains the back navigation in such scenarios.

Also do take a look at the Android's Navigation Component. , as you can maintain the flow of the navigation of the application properly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM