Example analysis of time display of short message list in Android programming

This paper describes the time display of short message list in Android programming. Share with you for your reference, as follows:

The time display of Android SMS is very fine. First, the SMS time saved in the SMS database mmssms.db is a long number. After the query action is completed and this value is obtained, the conversion will be performed. The specific conversion action is completed in the formattimestampstring function of messageutils.java;

It can be seen from the second specific function that Android determines the displayed time format based on the current time:

1. If the year in the current SMS time is inconsistent with the current year of the mobile phone, the year, month and day will be displayed, and the specific time and minute will not be displayed, such as June 30, 2010;

2. If the time of the SMS is the same year as the current time of the mobile phone, but not the same day, only the month and day are displayed, such as June 29;

3. If it is a message of the day, it will calculate whether it is a message in the morning or in the afternoon, and display the message recorded at what time, such as 12:55 p.m;

Taken into account, this display design is still very reasonable

I hope this article will help you in Android programming.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>