I have taken a look at the closely related tutorial on PocketBook (http://blog.pocketjourney.com/2008/05/0 ... urce-files - forum won't let me use URL tag on first post?), but from what I can tell it only applies to custom views that exist within an Android project.
Since I am trying to develop these views in an external library, the tutorial hasn't directly related to my situation. Therefore, when I am using one of these imported custom views in an Android project, I can't get the ADT to recognize the custom attributes.
For example, if I put the following in my main.xml:
Using xml Syntax Highlighting
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:m="http://schemas.android.com/apk/res/martin.android.widget"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- >
- <martin.android.widget.NumberPadEditText
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="0.00"
- android:textColor="#222244"
- m:keypadBackgroundDrawable="@drawable/popup_bg"
- />
- </LinearLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4
... I get an error stating "No resource identifier found for attribute 'keypadBackgroundDrawable' in package 'martin.android.widget"
To be honest, I am completely clueless as to where android looks to locate the custom attributes. I have tried including an R.java inside of the martin.android.widget package, but either it was formatted incorrectly, or this is the wrong place. Here are the contents of the R.java file:
Using java Syntax Highlighting
- package martin.android.widget;
- public final class R {
- /**
- * Custom xml attributes for custom widgets
- */
- public static final class attr {
- public static final int keypadBackgroundDrawable=0x7f010000;
- }
- public static final class styleable {
- public static final int[] NumberPadEditText = {
- 0x7f010000
- };
- public static final int NumberPadEditText_keypadBackgroundDrawable = 0;
- };
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
I was assuming that since R.java generally contains resource identifiers, that this is where android would be looking. I have a suspicion I'm on the wrong track altogether though - any pointers would be much appreciated!

