I'm sorry, maybe I have not understood the whole point. I have a xml:
<MyLayoutView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/my_item_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="2sp"> /* some button arranged with RelativeLayout directives (android:layout_toRightOf...) */ </MyLayoutView> Something like that: LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); MyLayoutView targetView = (MyLayoutView)inflater.inflate(R.layout.my_item_view, parent, false); Fails with a InflateException...binary file at line 2 of my xml. The class is extending a RelativeLayout as before. On Mar 17, 5:32 pm, TreKing <treking...@gmail.com> wrote: > On Thu, Mar 17, 2011 at 11:07 AM, Andrea Richiardi < > > andrea.richia...@gmail.com> wrote: > > And if i wanted not to inflate from outside the class, but inside? > > Then it's up to you to also dynamically set the layout parameters. > > > MyLayoutView view = new MyLayoutView(context); > > > without any inflation doesn't call the MyLayoutView(Context > > context, AttributeSet attrs) constructor I guess. > > > This is why I'm trying to pull parameters directly from the xml "inside" > > the Context only constructor. > > I'm kind of lost as to what you're trying to accomplish. What XML are you > pulling parameters from, if not the one that defines your custom layout > itself? > > ------------------------------------------------------------------------------------------------- > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago > transit tracking app for Android-powered devices -- 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