彩信发送/ recive日期始终是在1970年 [英] mms sent/recive date is always in 1970
本文介绍了彩信发送/ recive日期始终是在1970年的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
从codeI时能够得到彩信低于但日期总是错的。可能是我做错了什么,而转换。
from below code i am able to get the MMS but the date is always wrong. might be i am doing something wrong while conversion.
Cursor cursor = activity.getContentResolver().query(Uri.parse("content://mms"),null,null,null,date DESC);
count = cursor.getCount();
if (count > 0) {
cursor.moveToFirst();
long messageId = cursor.getLong(0);
long timestamp = cursor.getLong(2);
Date date = new Date(timestamp);
String subject = cursor.getString(3);
}
推荐答案
只是一些变化。
长时间戳= cursor.getLong(2)* 1000;
long timestamp = cursor.getLong(2) * 1000;
这篇关于彩信发送/ recive日期始终是在1970年的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文