Yes, the example comes from apidemo. app:text used in development\samples\apidemos\res\layout\custom_view_1.xml was declared at development\samples\apidemos\res\values\attrs.xml:
I thougt development\samples\apidemos\res\values\attrs.xml would declare namespace "app" at somewhere(xxx.xml or xxx.java), If it is true, where is it? If it is false, is there some information about these namespaces: xmlns:android xmlns:app xmlns:setting xmlns:androidprv Thanks gan On Jun 1, 12:29 am, Romain Guy <romain...@google.com> wrote: > You use the namespace you want except android. Appear is just an example. > > On May 31, 2009 6:17 AM, "gan" <gan_xiao_...@yahoo.com> wrote: > > There are many xmlns used in android: > xmlns:android="http://schemas.android.com/apk/res/android" > xmlns:app="http://schemas.android.com/apk/res/ > com.example.android.apis" > xmlns:settings="http://schemas.android.com/apk/res/ > com.android.settings" > xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" > > Take xmlns:app as example when it used, it have namespace information: > xmlns:app="http://schemas.android.com/apk/res/ > com.example.android.apis" > ... > <com.example.android.apis.view.LabelView > android:background="@drawable/green" > android:layout_width="fill_parent" > android:layout_height="wrap_content" > app:text="Green" app:textColor="#ffffffff" /> <<<<=== why > app:text not android:text, androidprv:text... > > But when decalre the attr "text", > <declare-styleable name="LabelView"> > <attr name="text" format="string" /> <<<========= why > where can we know it have namespace app? > <attr name="textColor" format="color" /> > <attr name="textSize" format="dimension" /> > </declare-styleable> > Nowhere specify the namespace "app", how can we know we should use > app:text instead of android:text, setting:text, androidprv:text > > Thanks > gan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "android-framework" group. To post to this group, send email to android-framework@googlegroups.com To unsubscribe from this group, send email to android-framework+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-framework?hl=en -~----------~----~----~----~------~----~------~--~---