Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum amount of activities in app? Android

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?

Explanation why I need 40 activities I 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 buttons I tried with contextual menu but it doesn't look good.

like image 291
user3231871 Avatar asked Oct 02 '22 06:10

user3231871


2 Answers

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.

like image 89
scottt Avatar answered Oct 05 '22 13:10

scottt


You can have as many activities as you want. There is no constraint on the number. All Android activities are stored in a stack and the one at the top of the stack is the one that is visible. When memory is low, the Android OS will automatically start killing the ones that are lower down the stack and are not running any background tasks or services.

like image 39
ucsunil Avatar answered Oct 05 '22 13:10

ucsunil