Fix NPE in ActivityController.

Using ActivityController.withApplication(Application) results in an NPE
because the base context is null.

Ensure that the Application object has a base context and is bound to
the proper resources.