Skip to content Skip to sidebar Skip to footer

Android String Resource Not Accessable: Android.content.res.resources$notfoundexception: String Resource Id

I tried to get all my strings into that strings.xml file. Now if I try to run it, i get this: E/AndroidRuntime: FATAL EXCEPTION: main Process: de.hsd.ip2.wgapp, PID:

Solution 1:

You can´t access your resources with Resources.getSystem(). Like defined in API:

Return a global shared Resources object that provides access to only system resources (no application resources)

instead you should use something like

context.getResources().getString(R.string.fLat),

or if you are inside an activity:

getResources().getString(R.string.fLat).

So your code must be:

fReference.child(getResources().getString(R.string.fLat)).child(Integer.toString(flatId))
            .child(getResources().getString(R.string.cleaning))
            .child(title)
            .setValue(r)

Post a Comment for "Android String Resource Not Accessable: Android.content.res.resources$notfoundexception: String Resource Id"