I have multiple activities which all have a ListView powered menu that appears on the click of a button.
These menus on each activity contain the same information, so instead of having to populate them by copying and pasting large amounts of code into each activity, I would like to have one class that will get the data and populate it.
One or two lines of code in each activity is fine, but I really want to slim this down as much as possible.
Anyone know of a way to do this?
Thanks,
Ashley
seems to be the best way 😉
You can insclude all the common code there.
If this menu is exactly the same you will just have to say for each one of your activity:
Here is an example that I used, because all my activity had the same code:
https://github.com/iRail/BeTrains-for-Android/blob/master/src/tof/cv/mpp/Activity/BeTrainsActivity.java