Search code examples
androidandroid-intentandroid-activitylayout

How to handle a large number of activities in android studio


Iam a student and Iam developing an app for my college for downloading previous year question papers,my college has 14 departments and for each department 8 semesters and in each semester minimum 10 subjects are there so 14*2*8= 1120 java files and XML files I have to create if I keep on intenting from one activity to another it will take a huge time.how handle this huge activities.my app structure would be Select department(14) >> Select sem(8)>> select subject(10) Is there any methods like nestedif or something else to reduce the activity files.if there are any methods please do help me to complete the project.thanks in advance


Solution

  • No, you don't need that many activities. You need to write abstract activities that take parameters and displays different data based on those. At most I see 4 activities here- department selector, semester selector, subject selector, and the actual subject activity. And arguably some of those should be fragments instead, although that's more personal choice.