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);