One more thing: The "tools" namespace is special. The android packaging tool knows to ignore it, so none of those attributes will be packaged into the APK. We're using it for extra metadata in the layout. It's also where for example the attributes to suppress lint warnings are stored -- as tools:ignore.android
tools:context="activity name"這一句不會被打包進APK。只是ADT的Layout Editor在你當前的Layout文件裏面設置對應的渲染上下文,說明你當前的Layout所在的渲染上下文是activity name對應的那個activity,若是這個activity在manifest文件中設置了Theme,那麼ADT的Layout Editor會根據這個Theme來渲染你當前的Layout。就是說若是你設置的MainActivity設置了一個Theme.Light(其餘的也能夠),那麼你在可視化佈局管理器裏面看到的背景阿控件阿什麼的就應該是Theme.Light的樣子。僅用於給你看所見即所得的效果而已。佈局