简体   繁体   English

如何将活动转换为片段?

[英]How to convert Activities to Fragments?

I'm new to android programming pls help. 我是android编程新手,请帮助。 It's just that I have this application modules created in Activities form. 只是我在“活动”表单中创建了此应用程序模块。 Now that I wanted to use the Android navigation bar to navigate between them, I can't do so, it seems that theres alot of things I would have to change such as the imports, the declarations, and omit certain methods etc. Is there a comprehensive manual for such task?. 现在,我想使用Android导航栏在它们之间进行导航,但现在不行了,看来我需要更改很多东西,例如导入,声明和省略某些方法等。有关此类任务的综合手册? I just can't seem to find one. 我只是找不到一个。 If there is, it's just limited to a few things. 如果有的话,它只限于几件事。 BTW, I just want to know how I would be able to do such task. 顺便说一句,我只是想知道我将如何完成这项任务。 If there is a for Dummies of it,would be the best. 如果有一个假人,那将是最好的。 Be better if it would also include the AppCompatActivity thing, I can't seem to combine it too with Fragments and Activities, :(. 如果它还包含AppCompatActivity会更好,我似乎也无法将它与Fragments and Activities组合在一起:(。

You need to understand your app's architecture first. 您需要首先了解应用程序的体系结构。 You need to analyse the flow of UI screens and the underlying logic they perform. 您需要分析UI屏幕的流程及其执行的基本逻辑。 If you want to navigate through your activities using Navigation Drawer, well, then converting all of them them into fragments isn't a solution! 好吧,如果您想使用导航抽屉浏览活动,那么将它们全部转换成片段不是解决方案! First find out which screens can perform flawlessly if you replace them with fragments and then go ahead with it. 首先,找出用碎片替换屏幕后,哪些屏幕可以完美运行,然后继续进行操作。 If you are new to android programming then visit Udacity online and watch all of their android tutorial videos! 如果您不熟悉android编程,请在线访问Udacity并观看其所有android教程视频! They have a bunch of comprehensive ones and the best part - it's free. 他们有一堆综合的东西和最好的部分-它是免费的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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