Yes, I'm admittedly weak on object-oriented design experience and
still tend to treat classes more like "subroutine libraries" than true
objects. I also miss the ability to simplify life (at least as far as
writing the initial code is concerned) by being able to fall back on
"global" variables that are visible everywhere.

But learning to program in Java will eventually cure me of this
ailment. :-)

On Aug 21, 11:38 pm, Mark Murphy <[email protected]> wrote:
> On Sat, Aug 21, 2010 at 11:12 PM, Doug Gordon <[email protected]> wrote:
> > Am I correct that this is the only way to do this?
>
> Yes.
>
> > Also, if I want to
> > use any other Android class that requires a context (e.g.
> > AlertDialog.Builder), I essentially have to "pass" the context from
> > the main Activity object to any class that needs to use it?
>
> Yes. The more you find that you are doing this, the more you have
> over-engineered your object model, IMHO.
>
> > I guess my main question is whether there's another way to get the
> > Context without having to pass it from class to class as an argument.
>
> No, sorry.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to Android Development_ Version 3.1 Available!

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