android:launchMode,即Activity的啓動模式,與Intent中的Flags共同做用,決定Activity如何啓動。html
android:launchMode分別有"standard", "singleTop", "singleTask", "singleInstance".android
"standard": 每次都建立新的實例;app
"singleTop": 若是目標Task的頂端是就是對應的實例,那麼這個實例將會接受新的Intent;不然,建立新的實例;less
"singleTask": 同一個Task中只容許存在一個實例,並且這個實例必須在該Task的Activity堆棧的低端,容許其餘Activity實例存在;ide
"singleInstance": 同一個Task中只容許存在一個實例,並且不容許其餘Activity實例存在。佈局
android:configChanges字體
當一些配置發生改變時,Activity將會關閉,而後重啓,可是配置了這個選項,能夠捕獲配置改變的事件,從而避免Activity重啓。ui
可捕獲的事件如:this
Value | Description |
"mcc " |
The IMSI mobile country code (MCC) has changed — a SIM has been detected and updated the MCC. 系統監測到SIM卡以後,會更新MCC。 |
"mnc " |
The IMSI mobile network code (MNC) has changed — a SIM has been detected and updated the MNC. 系統監測到SIM卡以後,會更新MNC。 |
"locale " |
The locale has changed — the user has selected a new language that text should be displayed in. 用戶更改系統語言。 |
"touchscreen " |
The touchscreen has changed. (This should never normally happen.) |
"keyboard " |
The keyboard type has changed — for example, the user has plugged in an external keyboard. 鍵盤發生改變,如用戶插入外接鍵盤。 |
"keyboardHidden " |
The keyboard accessibility has changed — for example, the user has revealed the hardware keyboard. 鍵盤可見性改變。 |
"navigation " |
The navigation type (trackball/dpad) has changed. (This should never normally happen.) |
"screenLayout " |
The screen layout has changed — this might be caused by a different display being activated. 屏幕布局發生變化,如其餘不一樣的顯示器打開了。 |
"fontScale " |
The font scaling factor has changed — the user has selected a new global font size. 用戶修改了系統全局字體大小。 |
"uiMode " |
The user interface mode has changed — this can be caused when the user places the device into a desk/car dock or when the night mode changes. See UiModeManager . Added in API level 8. 系統uiMode發生改變,如進入夜視模式。 |
"orientation " |
The screen orientation has changed — the user has rotated the device. 屏幕方向改變了,如旋轉屏幕。 Note: If your application targets API level 13 or higher (as declared by the |
"screenSize " |
The current available screen size has changed. This represents a change in the currently available size, relative to the current aspect ratio, so will change when the user switches between landscape and portrait. However, if your application targets API level 12 or lower, then your activity always handles this configuration change itself (this configuration change does not restart your activity, even when running on an Android 3.2 or higher device). 當前可用屏幕大小發生改變(用戶在切換屏幕橫/縱向時)。 Added in API level 13. |
"smallestScreenSize " |
The physical screen size has changed. This represents a change in size regardless of orientation, so will only change when the actual physical screen size has changed such as switching to an external display. A change to this configuration corresponds to a change in the smallestWidth configuration. However, if your application targets API level 12 or lower, then your activity always handles this configuration change itself (this configuration change does not restart your activity, even when running on an Android 3.2 or higher device). 物理屏幕發生改變時(鏈接外部顯示器) Added in API level 13. |
"layoutDirection " |
The layout direction has changed. For example, changing from left-to-right (LTR) to right-to-left (RTL). Added in API level 17.佈局方向發生改變。 |