Android Activity屬性

來源:互聯網
上載者:User

標籤:更換   retain   ever   hardware   and   執行個體   調用   his   parent   

  1 <activity android:name=".MainActivity"  2         android:alwaysRetainTaskState=["true" | "false"]  3         android:clearTaskOnLaunch=["true" | "false"]  4         android:configChanges=["mcc", "mnc", "locale",  5                                "touchscreen", "keyboard", "keyboardHidden",  6                                "navigation", "screenLayout", "fontScale", "uiMode",  7                                "orientation", "screenSize", "smallestScreenSize"]  8         android:enabled=["true" | "false"]  9         android:excludeFromRecents=["true" | "false"] 10         android:exported=["true" | "false"] 11         android:finishOnTaskLaunch=["true" | "false"] 12         android:hardwareAccelerated=["true" | "false"] 13         android:icon="drawable resource" 14         android:label="string resource" 15         android:launchMode=["multiple" | "singleTop" | 16                             "singleTask" | "singleInstance"] 17         android:multiprocess=["true" | "false"] 18         android:name="string" 19         android:noHistory=["true" | "false"] 20         android:permission="string" 21         android:process="string" 22         android:screenOrientation=["unspecified" | "user" | "behind" | 23                                    "landscape" | "portrait" | 24                                    "reverseLandscape" | "reversePortrait" | 25                                    "sensorLandscape" | "sensorPortrait" | 26                                    "sensor" | "fullSensor" | "nosensor"] 27         android:stateNotNeeded=["true" | "false"] 28         android:taskAffinity="string" 29         android:theme="resource or theme" 30         android:uiOptions=["none" | "splitActionBarWhenNarrow"] 31         android:windowSoftInputMode=["stateUnspecified", 32                                      "stateUnchanged", "stateHidden", 33                                      "stateAlwaysHidden", "stateVisible", 34                                      "stateAlwaysVisible", "adjustUnspecified", 35                                      "adjustResize", "adjustPan"] /> 36 . . . 37  38  39 // 是否允許activity更換從屬的任務,比如從簡訊息任務 切換到瀏覽器任務。 40 android:allowTaskReparenting=["true" | "false"] 41  42 // 是否保留狀態不變, 比如切換回home, 再從新開啟, activity處於最後的狀態 43 android:alwaysRetainTaskState=["true" | "false"] 44  45 // 比如 P 是 activity, Q 是被P 觸發的 activity, 然後返回Home, 從新啟動 P, 是否顯示 Q 46 android:clearTaskOnLaunch=["true"" | "false"] 47                             48 // 當配置list發生修改時, 是否調用 onConfigurationChanged() 方法 比如 "locale|navigation|orientation". 49 android:configChanges=[one or more of: "mcc" "mnc" "locale" "touchscreen" "keyboard" "keyboardHidden" "navigation" "orientation" "fontScale"] 50  51 // activity 是否可以被執行個體化 52 android:enabled=["true" | "false"] 53                             54 // 是否可被顯示在最近開啟的activity列表裡 55 android:excludeFromRecents=["true" | "false"] 56  57 // 是否允許activity被其它程式調用 58 android:exported=["true" | "false"] 59                             60 // 是否關閉已開啟的activity當使用者重新啟動這個任務的時候 61 android:finishOnTaskLaunch=["true" | "false"] 62  63                             64 android:icon="drawable resource" 65 android:label="string resource" 66  67 // activity啟動方式, "standard" "singleTop" "singleTask" "singleInstance" 其中前兩個為一組, 後兩個為一組 68 android:launchMode=["multiple" | "singleTop" |"singleTask" | "singleInstance"] 69  70  71 android:multiprocess=["true" | "false"] 72 android:name="string" 73  74 // 是否需要移除這個activity當使用者切換到其他螢幕時。 這個屬性是 API level 3 中引入的 75 android:noHistory=["true" | "false"] 76  77 android:permission="string" 78  79 // 一個activity運行時所在的進程名,所有程式組件運行在應用程式預設的進程中,這個進程名跟應用程式的包名一致。 80 // 中的元素process屬效能夠為所有組件設定一個新的預設值。但是任何組件都可以覆蓋這個預設值,允許你 81 // 將你的程式放在多進程中運行。 如果這個屬性被分配的名字以:開頭,當這個activity運行時,一個新的專屬於這個程式的 82 // 進程將會被建立。如果這個進程名以小寫字母開頭,這個activity將會運行在全域的進程中,被它的許可所提供。 83 android:process="string" 84  85 // activity顯示的模式, "unspecified" 預設值 "landscape" 風景畫模式,寬度比高度大一些 "portrait" 肖像模式, 高度比 86 // 寬度大。 "user" 使用者的設定 "behind" "sensor" "nosensor",其它幾個屬性3.0後被引入。 87 android:screenOrientation=["unspecified" | "user" | "behind" |"landscape" | "portrait" | "sensor" | "nonsensor"] 88  89  90 // 是否 activity被銷毀和成功重啟並不儲存狀態 91 android:stateNotNeeded=["true" | "false"] 92  93 // activity的親屬關係, 預設情況同一個應用程式下的activity有相同的關係 94 android:taskAffinity="string" 95  96 // activity的樣式主題, 如果沒有設定,則activity的主題樣式從屬於應用程式, 參見元素的theme屬性 97 android:theme="resource or theme" 98  99 // activity主視窗與軟鍵盤的互動模式, 自從API level 3 被引入。100 android:windowSoftInputMode=[one or more of: "stateUnspecified""stateUnchanged" "stateHidden" "stateAlwaysHidden"101                             "stateVisible""stateAlwaysVisible""adjustUnspecified""adjustResize" "adjustPan"]

 

Android Activity屬性

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.