On Mon, Feb 28, 2011 at 5:17 PM, Mike <[email protected]> wrote:

> Thanks, But won't that be a lot of repeating code?  ie the event handlers
> for those buttons will have to repeat in every activity.
> There has to be a cleaner way to do it....
>

It shouldn't be. If you're doing something that is so self-contained that it
can live within any of your activities, then you can create your own
component, "ButtonBar" that encapsulates all the logic you need, including
the button event handlers.

Perhaps some setter functions or constructor parameters to bind to the
specific Activity would required, but for the most part I don't see what it
would not just be a matter of defining your custom component and including
it in each activities main layout.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
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

Reply via email to