问题
TextView textview = (TextView)findViewById(timeScore);
i = (int)(gridView.getTime() / 1000L);
String s = getString(time_score);
Object aobj[] = new Object[1];
aobj[0] = Integer.valueOf(i);
textview.setText(String.format(s, aobj));
Getting Error in Android Studio in last conversion aobj
"Wrong Argument type for formatting argument #1 in time_score: conversion 'd', recevied Object (argument #2 in method call)"
回答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.
来源:https://stackoverflow.com/questions/31553910/android-studio-wrong-argument-type-for-formatting-error-in-string-format