【发布时间】:2015-07-22 04:32:52
【问题描述】:
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));
在上次转换 aobj 时在 Android Studio 中出现错误
“time_score 中格式化参数 #1 的参数类型错误:转换 'd',收到 Object(方法调用中的参数 #2)”
【问题讨论】:
-
显示
time_score的初始化 -
这里没有初始化,只从资源id获取String
-
请检查或评论答案。
-
Minhtdh 答案对我有用