Mark, Before you suggested the utility class, I packaged the code in a jar which I added to the project.
Are there any pro/cons for the utility class vs the jar? This will be used within one app and not across apps. Thanks A. On Oct 7, 10:41 am, "Mark Murphy" <[email protected]> wrote: > > 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 -~----------~----~----~----~------~----~------~--~---

