Or you could use the getTag and setTag methods on your view: myView.setTag(myActivity) ... myActivity = (MyActivity)someView.getTag(); ...
On Oct 28, 5:08 pm, ClarkBattle <[email protected]> wrote: > Very tricky. I like it! Thanks. > > On Oct 28, 1:12 pm, RichardC <[email protected]> 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 <[email protected]> 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.- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

