[android-developers] Re: Assign LayoutParams from Xml

2011-03-18 Thread Andrea Richiardi
It works like a charm! Thanks! On 17 Mar, 21:25, Andrea Richiardi andrea.richia...@gmail.com wrote: Thanks guys, I missed that article. I'll try! On 17 Mar, 18:16, Kostya Vasilyev kmans...@gmail.com wrote: 17.03.2011 20:02, TreKing ?: I don't think you add the xmlns declaration to

[android-developers] Re: Assign LayoutParams from Xml

2011-03-17 Thread Andrea Richiardi
And if i wanted not to inflate from outside the class, but inside? I mean: 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

Re: [android-developers] Re: Assign LayoutParams from Xml

2011-03-17 Thread TreKing
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

[android-developers] Re: Assign LayoutParams from Xml

2011-03-17 Thread Andrea Richiardi
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

Re: [android-developers] Re: Assign LayoutParams from Xml

2011-03-17 Thread TreKing
On Thu, Mar 17, 2011 at 11:52 AM, Andrea Richiardi andrea.richia...@gmail.com wrote: Fails with a InflateException...binary file at line 2 of my xml. I don't think you add the xmlns declaration to your custom view. That's for Android defined views. Have you read this:

Re: [android-developers] Re: Assign LayoutParams from Xml

2011-03-17 Thread Kostya Vasilyev
17.03.2011 20:02, TreKing ?: I don't think you add the xmlns declaration to your custom view. That's for Android defined views. The repeated xmlns:android is unnecessary, but harmless. A custom view needs to use a full-qualified class name, either in the start tag, like this:

[android-developers] Re: Assign LayoutParams from Xml

2011-03-17 Thread Andrea Richiardi
Thanks guys, I missed that article. I'll try! On 17 Mar, 18:16, Kostya Vasilyev kmans...@gmail.com wrote: 17.03.2011 20:02, TreKing ?: I don't think you add the xmlns declaration to your custom view. That's for Android defined views. The repeated xmlns:android is unnecessary, but