我有一个读取传入和传出短信的应用程序。Logcat 正确显示除日期字符串之外的所有变量。它总是这样。1254785965412。下面是我的代码,如何将此毫秒时间更改为可读格式,例如下午 2:50 或 6 月 25 日 14:50。
Uri smsURI = Uri.parse("content://sms/sent");
Cursor c = getContentResolver().query(smsURI, new String[]{"address", "date", "body", "type"}, null, null, null);
String[] columns = new String[]{"address", "date", "body", "type"};
c.moveToNext();
String recipient = c.getString(c.getColumnIndex(columns[0]));
String date = c.getString(c.getColumnIndex(columns[1]));
String message = c.getString(c.getColumnIndex(columns[2]));
String type = c.getString(c.getColumnIndex(columns[3]));
Log.d("DetectOutgoingSMS", recipient + " , " + date + " , " + message + " , " +type);