sorted it out. can't call findViewById() in the ContactView constructor, as its tree hasn't been inflated under it yet. at least i think that's what's going on.
the ListView can see ContactView children just fine. thanks for the responses, chaps. >What Mark said. Also, the correct usage of inflate() in adapters is: > >inflate(layoutId, parent, false); > >Passing the parent (given to you as a parameter in getView()) allows >the UI toolkit to create the appropriate LayoutParams object. Passing >false tells the toolkit to NOT call parent.addView(theInflateChild), >since ListView will do its own magic later on. > >On Mon, Sep 28, 2009 at 2:11 PM, Mark Murphy <mmur...@commonsware.com> wrote: >> >> Jason Proctor wrote: >>> i thought by now you could read my mind :-) >>> >>> assuming that the XML enclosed in the post is in >>>res/layout/contact_view.xml >>> >>> in the custom ListView... >>> >>> LayoutInflater inflater = LayoutInflater.from (this.context); >>> >>> // passing null here, as i'm assuming that the ListView will hook the >>> view up with its hierarchy >>> ContactView contactView = (ContactView) inflater.inflate >>> (R.layout.contact_view, null); >>> >>> in the custom item View... >>> >>> LinearLayout top = (LinearLayout) findViewById (R.id.contact_top_layout); >> >> Try contactView.findViewById(). >> >> -- >> Mark Murphy (a Commons Guy) >> http://commonsware.com | http://twitter.com/commonsguy >> >> Android Development Wiki: http://wiki.andmob.org >> >> > >> > > > >-- >Romain Guy >Android framework engineer >romain...@android.com > >Note: please don't send private questions to me, as I don't have time >to provide private support. All such questions should be posted on >public forums, where I and others can see and answer them > > -- jason.vp.engineering.particle --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---