如何在android studio中控制多个活动 [英] How do I control multiple activities in android studio

查看:344
本文介绍了如何在android studio中控制多个活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个具有物理,化学和数学各种公式的公式应用程序。

但问题是每个主题至少有20章,所以这就像60-70章。因此,如果我将进行那么多活动,我的应用程序大小肯定会增加。而且我的代码也很复杂。有没有简单的方法可以做到这一点。



我尝试过:



我试图制作所有章节的活动,但这很大,我不能

I am currently working on a Formula app that has every formula of Physics, Chemistry and Maths.
But the problem is that each subject has atleast 20 chapters, so that's like 60-70 chapters. So if I will make that much activities my app size will definitely increase. And also my code will be complicated. Is there any easy way to do this.

What I have tried:

I tried to make activities of all chapters but that's huge and I couldn't

推荐答案

为每一章创建一个单独的活动是没有意义的。这是分离演示文稿和数据的问题。这些章节的内容是可以存储在某些存储中的数据[ ^ ]在您的应用之外。实际上,您只需要一个Activity(演示文稿)即可在任何时间显示每个章节。如果您需要一些不同的演示文稿,请考虑将它们转换为片段 [ ^ ]用于嵌入该活动。
It makes no sense to create a separate activity for each chapter. This is a matter of separating the presentation and the data. The content of these chapters are data which can be stored in some storage[^] outside of your app. In fact, you only need one Activity (presentation) to display each chapter at any one time. If you need a few different presentations, consider making them into Fragments[^] for embedding in that Activity.


这篇关于如何在android studio中控制多个活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆