Reputation: 1197
I am have trouble accessing a string I stored in strings.xml and don't know why.
res/values/strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="FileBrowser">FileBrowser</string>
<string name="menu_settings">Settings</string>
<string name="up_one_level">..</string>
<string name="current_dir">.</string>
</resources>
Code
this.directoryEntries.add(getString(R.string.current_dir)); //current_dir is not being seen
Upvotes: 0
Views: 2634
Reputation: 5986
Check that you did not add the following import by mistake:
import android.R
It happened to me several times this week.
Delete this line and everything will work as expected.
Upvotes: 2
Reputation: 8528
Usually this means you have an error in one of your XML files so it can't rebuild your resources. Look under the problems tab in Eclipse and you'll probably see an XML issue, could be in any of your XML files, not necessarily in strings.xml
.
Upvotes: 1