Referencing a custom defined View within an XML by its relative path?

Go To StackoverFlow.com

0

I've defined a class MarkerView which extends ImageView and to use this View, I have to reference it like this:

<PACKAGE_NAME.MarkerView  android:id="@+id/startmarker" android:contentDescription="@string/start_marker" />

I'd like to define my XML files without the need of the PACKAGE_NAME. Is this possible? I've tried

<.MarkerView  android:id="@+id/startmarker" android:contentDescription="@string/start_marker" />

but this didn't work.

Thanks!

2012-04-04 17:55
by Robert Bana
You can't. Why do you need to use only the custom view name - Luksprog 2012-04-04 17:58


0

No i dont think its possible in xml file. if it was class files we can have import option but in xml we dont have any such option.

2012-04-04 17:58
by Shankar Agarwal
Ads