You are calling this while the app is running, and it hasn't finished initializing.
Generally you should be very careful about directly touching app objects like this from tests, since the test is running in a separate thread. There are APIs to allow you to run code on the main thread to access its objects. On Wed, Mar 4, 2009 at 10:00 AM, AndyM <[email protected]> wrote: > > I have a simple androidTestCase class that has this test: > > @MediumTest > public void testFoo() { > assertNotNull(this.mContext.getApplicationContext()); > } > > this fails unless I sleep first, then it passes. Whats the deal? > > > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

