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 xml
"inside" the Context only constructor.

At least, I'm trying to implement it this way...

In any case, thanks for the fast answer! :-)


On 17 Mar, 16:54, TreKing <treking...@gmail.com> wrote:
> On Thu, Mar 17, 2011 at 10:46 AM, Andrea Richiardi <
>
> andrea.richia...@gmail.com> wrote:
> > "Is there a way to get android:XXX param from xml e assign them via code?"
>
> Override the constructor that takes an AttributeSet, which is what is called
> when the View is inflated from XML. It should do all the work for you. Then
> you can parse out custom properties if you have any for you custom view.
>
> http://developer.android.com/reference/android/widget/RelativeLayout....,
> android.util.AttributeSet)
>
> -------------------------------------------------------------------------------------------------
> 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

Reply via email to