> I have an app with two activities. > > Both activities among other functions have to perform the same > calculation on data, so each activity include the same code to perform > the calculation. > > Is it possible to only have the similar code in a separate activity > and be accessed by the other two activities instead of duplicating the > code twice?
Create a utility class that both activities can use that has your calculation code. Assuming the activities and the utility class are all in the same application, you should encounter no problems. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

