本文介绍了应用程式中的活动数量上限?安卓的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android应用程序中是否存在诸如最大活动量之类的东西?我想知道,因为我正在考虑创建具有铃声功能的声音应用程序.它将大约有40项活动.但是只有1个会持续运行.太过分了吗?我应该找到另一种方法吗?

Is there something like maximum activities in android app?I would like to know because I am thinking to create sound app with ringtone feature. It will have roughly around 40 activities. But only 1 will be running constantly.Is that too much? Should I find another way?

说明为什么我需要40个活动我有30种声音,我想将它们设置为铃声.1个正常活动,带有播放Mp和素材的按钮,以及35个其他活动,每个文件1个.我想要的是使用布局进行长按开始活动,并且会有更多按钮我尝试了上下文菜单,但效果不好.

Explanation why I need 40 activitiesI have 30 sounds and I want to set them as ringtone.1 normal activity with buttons to play Mp and stuff, and 35 other activities, 1 for each file.What I want is to on Long click start activity with layout and there will be more buttonsI tried with contextual menu but it doesn't look good.

推荐答案

由于活动数量众多,您不应该直接遇到问题,但是我对您的设计提出了疑问.可能很难正确设置并遭受性能问题,并且APK可能非常大.

You shouldn't have a problem directly due to the number of activities, but I question your design. It will likely be difficult to get right and suffer performance issues and the APK will probably be very overly large.

另一种方法可以利用以下事实:您可以针对单个活动有选择地使用/显示不同的布局,并且单个布局可以有选择地显示同一可见空间中的不同组件.

An alternative approach could utilize the fact that you can selectively use/show different layouts for a single activity and that a single layout can selectively show different components in the the same visible space.

这篇关于应用程式中的活动数量上限?安卓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 13:40