Skip to content Skip to sidebar Skip to footer

Android Studio "Wrong Argument Type For Formatting Error" In String.format()

TextView textview = (TextView)findViewById(timeScore); i = (int)(gridView.getTime() / 1000L); String s = getString(time_score); Object aobj[] = new Object[1]; aobj[

Solution 1:

I think it's because of textview.setText(String.format(s, aobj));

Your string format require integer value but you pass a array to it.

Try this: textview.setText(String.format(s, i));

Hope this helps.


Post a Comment for "Android Studio "Wrong Argument Type For Formatting Error" In String.format()"