Merge "Update Instrumentation.newActivity to pass non-null application." into pi-dev
am: 850c6662b0
Change-Id: I152d5029366aba600dc81ea6eb9113ff22fd1bec
This commit is contained in:
@@ -1182,6 +1182,10 @@ public class Instrumentation {
|
|||||||
IllegalAccessException {
|
IllegalAccessException {
|
||||||
Activity activity = (Activity)clazz.newInstance();
|
Activity activity = (Activity)clazz.newInstance();
|
||||||
ActivityThread aThread = null;
|
ActivityThread aThread = null;
|
||||||
|
// Activity.attach expects a non-null Application Object.
|
||||||
|
if (application == null) {
|
||||||
|
application = new Application();
|
||||||
|
}
|
||||||
activity.attach(context, aThread, this, token, 0 /* ident */, application, intent,
|
activity.attach(context, aThread, this, token, 0 /* ident */, application, intent,
|
||||||
info, title, parent, id,
|
info, title, parent, id,
|
||||||
(Activity.NonConfigurationInstances)lastNonConfigurationInstance,
|
(Activity.NonConfigurationInstances)lastNonConfigurationInstance,
|
||||||
|
|||||||
Reference in New Issue
Block a user