Tag: 非法状态

Android Kotlin StringRes quantityString

好,所以这个: fun Context.quantityFromRes(id_: Int, qtt:Int, vararg format: Any) = resources.getQuantityString(id_, qtt, format) XML: <plurals name="header_view"> <item quantity="one">Oh no! You just lost %1$d Point</item> <item quantity="other">Oh no! You just lost %1$d Points</item> </plurals> 给出这个错误: "java.util.IllegalFormatConversionException: %d can't format [Ljava.lang.Object; arguments" 明显的Java修复: public class XmlPluralFormatter { private XmlPluralFormatter() { throw new IllegalStateException("You can't fuck me =("); } […]