I am getting this error:
> android.content.Context.getMainLooper()' on a null object reference
>
When calling
new GoogleApiClient.Builder(getApplication())
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Locati
Thanks for the response. The assets that I needed for the test
project were specifically built for testing and we could not
distribute them in the assets of our app (we are keeping the app
footprint small), but the workaround I posted above worked fine to get
the assets from the test project.
On
Hmmm.
ServiceTestCase.getSystemContext() returns the context of the test
package. ServiceTestCase.getApplication() gets the Application
instance in use by the service under test. It's probably better to use
that Application object to look at the assets you want.
When you wrote getContext(), I did
OK, I found a solution:
I created a context to our test package and was able to access the
assets:
mTestAppContext = getContext().createPackageContext("com.blah.test",
Context.CONTEXT_IGNORE_SECURITY);
Just in case anyone else needs a workaround.
On Feb 4, 10:36 am, nate wrote:
> Also, i put t
Also, i put the test assets in the target project's directory and was
able to access them with:
getSystemContext().getAssets().list(".")
On Feb 4, 10:31 am, nate wrote:
> I checked my setUp() method and I do call super.setUp() as the first
> line. The reason I believe the contexts are the same
I checked my setUp() method and I do call super.setUp() as the first
line. The reason I believe the contexts are the same are two-fold:
I tried both:
getSystemContext().getAssets().list(".")
getContext().getAssets().open(".");
and neither of them listed any files. The second reason is that I
r
What leads you to believe that both Context objects contain the same
information? If you do a getSystemContext() you should get the context
that's stored during setUp(). The only thing that might screw this up
is if you overrode setUp() but forgot to call super.setUp() first.
On Feb 2, 2:08 pm, na
7 matches
Mail list logo