I have created a custom view as well as corresponding custom attributes. For example
<declare-styleable name="stripbar">
<attr name="flowDirection" format="string"/>
</declare-styleable>
and
public Stripbar(Context context, AttributeSet attrs)
{
super(context, attrs);
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.stripbar);
CharSequence flowDirection = ta.getString(R.styleable.stripbar_flowDirection);
String text = attrs.getAttributeValue("android", "text");
}
and
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ns="http://schemas.android.com/apk/res/com.ns">
<com.ns.Stripbar
android:id="@+id/aaa"
ns:flowDirection="RightToLeft"
android:text=”yoo hoo”/>
I receive null value for attribute text. I’m also aware of this and do not know how to resolve the issue.
To clarify, I need to obtain my custom attribute value as well as android predefined attribute value side by side?
Any help?