Can I create independent layout files for UI without necessarily creating a new activity. Plus I want some buttons to open them. | Sololearn: Learn to code for FREE!
0

Can I create independent layout files for UI without necessarily creating a new activity. Plus I want some buttons to open them.

Am making this app that is more like a 6 month calendar. I have created 6 different activities. Each activity has 30 to 31 buttons and they are all suppose to open a different activities entirely. Now do I have to create (30 * 6) 180 activities? Or I could just create layout that are open when those buttons are clicked? Is this possible, to create layout files with textview, scrollview and with backwards compatibility and logical parent without having to create a new activity altogether? Plus these layouts will not have a click able elements. I am scared of how messed up my manifest would be with such many activities. Thanks in advance

9th Jan 2019, 10:31 PM
Topa Sunday
Topa Sunday - avatar
2 Answers
+ 1
The good way of programming is to have a less code , you can create only one activity for all the months and have a 31 buttons on it. the trick is to hide and view buttons based on specific month days. Create another activity to view content when a button is clicked(day). You can know which button is clicked by passing a value (day number) to the second activity and use that value to view different content.
27th Jan 2019, 4:50 AM
Mohamed Adil
Mohamed Adil - avatar
0
Thanks a lot. I get the idea after reading a few times. It a really great one. But I don't know how to do that. Don't know if you could help me further. Thanks
30th Apr 2019, 2:14 PM
Topa Sunday
Topa Sunday - avatar