Very tricky. I like it! Thanks.
On Oct 28, 1:12 pm, RichardC <richard.crit...@googlemail.com> wrote:
> In your activity onCreate method
> 1. find your custom view by id.
> 2. call a method on your custom view and pass it "this" (of your
> activity class) and save it in the custom view.
>
> In the custom view used the saved reference to your activity class to
> call back into your activity class when you need to.
>
> --
> RichardC
>
> On Oct 28, 7:40 pm, ClarkBattle <clarkbat...@gmail.com> wrote:
>
> > I have a custom view that needs a reference to the activity that
> > created it.
>
> > Dianne Hackborn said in another thread:
>
> > >Give your view a reference to the activity (or a Java interface it
> > >implements) and call back through that.
> > >Much much MUCH more efficient than sending a broadcast.
> > >See all of the standard view and view subclass callbacks for examples.
>
> > Sadly, I dont understand her reply and cant find any decent examples
> > that show how to do this.
>
> > Can anyone point me to an example or post one here?
>
> > Thanks.
--~--~---------~--~----~------------~-------~--~----~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---