Why does android need showAsAction="always" to be prefixed with an alias? -


i started journey on android development , there's 1 thing confusing me.

when creating menu items why need specify alias properties when android studio's autocomplete suggests use of android:showasaction="value"?

when using android:showasaction property ignored. if replace else works. why?

related https://stackoverflow.com/a/17914095/1084568

if using native action bar, use android:showasaction. time see android: prefix, know attribute defined android framework.

if using appcompat-v7 backport of action bar, comes library (appcompat-v7). libraries cannot invent new android: attributes. instead, library-defined attributes, use new namespace (e.g., app:) tied http://schemas.android.com/apk/res-auto url.

it says android: namespace not able provide access property if pretend support older android versions such 2.1

correct. in case, while android:showasaction added framework in android 3.0, part of goal of appcompat-v7 support android 2.1. while google has time machine, have not been using "retcon" android , add in attributes formerly did not exist.

(though, if did, wouldn't know it, our past have been altered have attributes, unless somehow have existence outside normal space-time continuum, seems involve wearing cape)

so, appcompat-v7 can use attributes android:icon, existed android 1.0, cannot support android:showasaction prior android 3.0. hence, have own attribute.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -