I am trying to use plurals in my latest Android project (SDK9). It always ends in an ResourcesNotFoundException. But the Resource is there - definitely:
Here's that part of my strings.xml:
<plurals name="count_files">
<item quantity="one">%d file</item>
<item quantity="other">%d files</item>
<item quantity="zero">%d files</item>
</plurals>
<plurals name="count_folders">
<item quantity="one">%d folder</item>
<item quantity="other">%d folders</item>
<item quantity="zero">%d folders</item>
</plurals>
And here's that part that's using it:
textView.setText(
getResources().getQuantityString(R.plurals.count_folders, countfolders, countfolders)
+ ", "
+ getResources().getQuantityString(R.plurals.count_files, countfiles, countfiles));
Here's the exception:
android.content.res.Resources$NotFoundException: Plural resource ID #0x7f050001 quantity=0 item=other
I do have to maintain up to 15 different languages thus I need localization of text and plurals.
Any idea what's wrong with my code?
Many thanks in advance.