I want to use Android's plurals
resource.
Most questions out there mentioned that "one" is working but the other quantities are not;
But I am encountering the opposite...
Strings.xml
<plurals name="imagepicker_multiselect_not_enough">
<item quantity="one">You have to select %d more image</item>
<item quantity="other">You have to select %d more images</item>
</plurals>
<plurals name="imagepicker_multiselect_enough">
<item quantity="one">You have selected %d image</item>
<item quantity="other">You have selected %d images</item>
</plurals>
Note that I also tried 1 image
instead of %d image
.
SomeFragment.java
if (newCount < minimumMultiSelectCount) {
tvMultiSelectMessage.setText(getContext().getResources().getQuantityString(
R.plurals.imagepicker_multiselect_not_enough,
minimumMultiSelectCount - newCount,
minimumMultiSelectCount - newCount));
} else {
tvMultiSelectMessage.setText(getContext().getResources().getQuantityString(
R.plurals.imagepicker_multiselect_enough, newCount, newCount));
}
I am always getting "You have selected 1 images" or "You have to select 1 more images"...
I made sure that this is the only place tvMultiSelectMessage
has been called.
I also tried clean and rebuild, uninstall and reinstall, no luck...
Any idea?!
UPDATE
Just now I tried to change other
to few
, and I got this Exception:
Resources$NotFoundException: Plural resource ID #0x7f0c0001 quantity=1 item=other
quantity=1 item=other
quantity=1 item=other
.....
quantity=1 item=other
!!!!
Should I already treat it as bug?