在初始化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应该是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;
}
里面被赋值的到这里就不太明白了 这是怎么回事啊 有没有大神给解释下啊