Date startDate = new Date(System.currentTimeMillis());
在收到设备返回数据之后添加如下语句:
Date endDate = new Date(System.currentTimeMillis());
long diff = endDate.getTime() - startDate.getTime();
然后在文本框中显示出来:
String sDiff = String.valueOf(AmoComActivity.Diff);
((TextView) findViewById(R.id.edit_text)).setText(sDiff);
时间: 2024-10-10 19:57:30