最新の Android プロジェクト (SDK9) で複数形を使用しようとしています。常に ResourcesNotFoundException で終了します。しかし、リソースはそこにあります-間違いなく:
これが私の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>
そして、これを使用している部分は次のとおりです。
textView.setText(
getResources().getQuantityString(R.plurals.count_folders, countfolders, countfolders)
+ ", "
+ getResources().getQuantityString(R.plurals.count_files, countfiles, countfiles));
例外は次のとおりです。
android.content.res.Resources$NotFoundException: Plural resource ID #0x7f050001 quantity=0 item=other
最大 15 の異なる言語を維持する必要があるため、テキストと複数形のローカライズが必要です。
私のコードの何が問題なのですか?
よろしくお願いします。