Here is my code, placed in main.xml:
                <view
                        class="MyButton"
                        style="?myButtonStyle"
                        android:text="test_text"
                        android:layout_weight="1"
                        />

MyButton constructor looks like this:

        public MyButton(Context pContext, AttributeSet pAttrs) {
                super(pContext, pAttrs);

                inflate (pContext, R.layout.mybutton, this);
                TextView cnt = (TextView) findViewById(R.id.buttoncontent);
                cnt.setText(pAttrs.getAttributeValue("android", "text"));
        }

In this case pAttrs.getAttributeValue("android", "text") returns null.
If I try to get attribute value by id, not by namespace and name,
pAttrs.getAttributeValue(0) returns "test_text" i.e. what I want.
But I need to get this value by attribute name. How can I do that?

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to