【发布时间】:2014-08-02 02:44:48
【问题描述】:
我收到错误:-
INSTRUMENTATION_STATUS: stack=android.util.TimeFormatException: 字符串太短 - 至少需要 8 个字符。
public void test() {
TextView onDeviceTime = (TextView) mNextUIMainActivity.findViewById(R.id.timeOfDay);
Time onSystem = new Time();
onSystem.setToNow();
Time onLauncherDisplay = new Time();
onSystem.parse(onDeviceTime.getText().toString());
if (onDeviceTime.equals(onSystem)) {
System.out.println("Correct time!");
}
}
【问题讨论】:
-
而不是字符串比较尝试毫秒差异
-
@JigarJoshi natak na karis...sarkhi rite javab apavo hoi to aap