Laur's blog
  • Home
  • About
  • Support my work
Sign in Subscribe

npe

A collection of 1 post
NullPointerException - getInstrumentation().getContext()
android

NullPointerException - getInstrumentation().getContext()

Here's a beginner mistake... The following code: public class ReactiveApiTest extends InstrumentationTestCase { protected LocalJsonClient mLocalJsonClient; public ReactiveApiTest() { super(); mLocalJsonClient = new LocalJsonClient( getInstrumentation().getContext() ); } // ... } Throws an exception: Attempt to invoke virtual method 'android.content.Context android.app.Instrumentation.getContext()' on a null object reference It to
Mar 11, 2015 1 min read
Page 1 of 1
Laur's blog © 2025
  • Sign up
Powered by Ghost