在初始化UiAutomation的時候返回了一個null值 看API是通過Instrumentation.getUiAutomation()來獲取UiAutomation的實例的啊
public UiAutomation getUiAutomation() {
if (mUiAutomationConnection != null) {
if (mUiAutomation == null) {
mUiAutomation = new UiAutomation(getTargetContext().getMainLooper(),
mUiAutomationConnection);
mUiAutomation.connect();
}
return mUiAutomation;
}
return null;
}
這是API中的其中 一段返回null應(yīng)該是mUiAutomationConnection==null
mUiAutomationConnection是在
/*package*/ final void init(ActivityThread thread,
Context instrContext, Context appContext, ComponentName component,
IInstrumentationWatcher watcher, IUiAutomationConnection uiAutomationConnection) {
mThread = thread;
mMessageQueue = mThread.getLooper().myQueue();
mInstrContext = instrContext;
mAppContext = appContext;
mComponent = component;
mWatcher = watcher;
mUiAutomationConnection = uiAutomationConnection;
}
里面被賦值的到這里就不太明白了 這是怎么回事啊 有沒有大神給解釋下啊
歡迎選擇我的課程,讓我們一起見證您的進(jìn)步~~