I have an Activity that pulls an object from an Application extended class (application context) from within the OnCreate() method.
Always use this.getInstrumentation().getTargetContext() to access the context of the application.
this.getInstrumentation().getTargetContext().getApplicationContext()
is not same as this.getInstrumentation().getTargetContext()
I was running the automation in 4.0.X versions and most of the time getApplicationContext() was returning null context.