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.
Merge pull request #1386 from noelmansour/with-application

Fix NPE in ActivityController.