I need to enter text like开发者_开发知识库 the following
So far {0, integer} items added out of {1, integer} items.
It does not do the substitution. Here is my code which should do the substitution.
MyActivity.this.getString(R.string.msgSoFarOutOf, new Object[]{Integer.valueOf(itemsAdded), Integer.valueOf(itemssTotal)})
You need to use %d
, %s
, etc., same as for String.format()
. BTW, getString() is a varargs method, so you don't need an array.
精彩评论