pivotal/robolectric — Issue #164: Robolectric.application.getResources().getString(); doesn't fetch string.
Author: diarmad
Created: 2011-12-07 23:20:29+00:00
State: open

While trying to fetch a string resource from my project, calling:

String blah = Robolectric.application.getResources().getString(R.id.blah);

query ends up null after this call. The resource in question works in the activity it's being called from, but when I try to use it in my testing environment, I can't seem to get to it. The normal way in Android is using Activity.getResources().getString(), so I figured it would work the same in Robolectric. Simple misunderstanding on my behalf, or legitimate bug?