True. To make it more generic, some class checking should be done.

On Apr 8, 12:28 am, hackbod <[EMAIL PROTECTED]> wrote:
> On Apr 7, 11:52 pm, "Dan U." <[EMAIL PROTECTED]> wrote:
>
> > > Inside a view, apparently we can't get a reference to the Activity
> > > that contains us (the view), and even if there is a way to get the
> > > reference, we can't probably call it directly, due to UI threading
> > > issues.
> > You do have access to the Activity. It's actually the Context that
> > gets passed into the view constructor. You'll just have to cast it to
> > Activity.
>
> Though formally you shouldn't assume the Context you have in a view is
> an Activity (for example the Dialog class creates a wrapper of the
> context you give it that is set up to have the correct theme for a
> dialog)...  for a particular application, if you know that the Context
> you used to create a view is actually an Activity (because after all
> that is the thing you passed to the view constructor or inflate
> function), then doing this should be fine.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to