I want to extend a defined Android widget as is done in the
com.example.android.notepad example, but I also want to add custom
attributes to the widget.  I can't figure out how to add a new
namespace though (I suspect this has to do with my XML/Schema
ignorance.)  Would someone please direct me to what I might be doing
wrong?  Thanks!

First I tried this, which compiles but the GetAttributeValue returns
null.

NoteEditor.java:
...
    public static class LinedEditText extends EditText {
        private Rect mRect;
        private Paint mPaint;

        // we need this constructor for LayoutInflater
        public LinedEditText(Context context, AttributeSet attrs) {
            super(context, attrs);
            String anAttr = attrs.getAttributeValue("","test");
...

note_editor.xml:
...
<view xmlns:android="http://schemas.android.com/apk/res/android";
class="com.example.android.notepad.NoteEditor$LinedEditText"
    android:id="@+id/note"
    test="hi"
    android:layout_width="fill_parent"
...

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