文法(SYNTAX):
<instrumentationandroid:functionalTest=["true" | "false"]
android:handleProfiling=["true" | "false"]
android:icon="drawable resource"
android:label="string resource"
android:name="string"
android:targetPackage="string"/>
被包含於(CONTAINED IN):
<manifest>
說明(DESCRIPTION):
這個元素宣告了一個Instrumentation類,這個類能夠監視應用程式跟系統的互動。Instrumentation對象會在應用的其他所有組件被執行個體化之前執行個體化。
屬性(ATTRIBUTES):
android:functionalTest
這個屬性用於指定Instrumentation類是否應該作為一個功能性的測試來運行,如果設定為true,這要運行,否則不應該運行。預設值是false。
android:handleProfiling
這個屬性用於指定Instrumentation對象是否會開啟和關閉分析功能。如果設定為true,那麼由Instrumentation對象來決定分析功能的啟動和終止時機,如果設定為false,則分析功能會持續到Instrumentation對象整個運行周期。如果設定為true,會使Instrumentation對象針對一組特定的操作來進行分析。預設值是false。
android:icon
這個屬性用於給Instrumentation類設定一個表徵圖。它必須要應用一個可繪製的資源。
android:label
這個屬性用於給Instrumentation類設定一個使用者可讀的標籤。這個標籤可用原生字串,也可以引用一個字串資源。
android:name
這個屬性用於設定Instrumentation子類的名稱。應該是完整的Java類名(如:com.example.project.StringInstrumentation)。但是,也可以用簡寫方式(如:.StringInstrumentation),它的包名會使用<manifest>元素的package屬性中指定的包名。
它沒有預設值,必須被指定。
android:targetPackage
這個屬性用於指定Instrumenttation對象所監視的應用程式。由包名所標識的應用程式會跟清單的<manifest>元素的package屬性值相關聯。
被引入版本(INTRODUCED IN):
API Level 1
摘自 FireOfStar的專欄