use android prefix on xml (android:, app:, @.., ...) -


on androidstudio in xml file don't understand difference between item android prefix , item without part of source code example:

<style name="apptheme" parent="theme.appcompat.light.noactionbar">     <item name="colorprimary">@color/colorprimary</item>     <item name="colorprimarydark">@color/colorprimarydark</item>     <item name="coloraccent">@color/coloraccent</item>     <item name="android:textcolorprimary">@color/white</item>     <item name="android:textcolorsecondary">@color/white</item>     <item name="actionmenutextcolor">@color/white</item> </style>  <style name="apptheme.toolbar" parent="widget.appcompat.toolbar">     <item name="android:background">@color/grey</item> </style> 

in xml file why attributes want prefix (android:) , other not. example:

<item name="android:textcolorprimary">@color/white</item> 

this part of code works correctly, when code below used, doesn't works: <item name="textcolorprimary">@color/white</item> can me know difference between prefix, , when use it. thanks

that because of attributes different xml name space. in layout files, may have seen like:

<linear layout xmlns:android="http://schemas.android.com/apk/res/android"> 

you need way tell compiler referencing attributes location, ,

"android:"  

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -