一對一視訊聊天APP源碼根據系統顯示時間的相關代碼
public boolean is24Hour() { String strTimeFormat = android.provider.Settings.System.getString(mContext.getContentResolver(),
android.provider.Settings.System.TIME_12_24);
if (strTimeFormat == null) {
if (DateFormat.is24HourFormat(mContext)) {
return true;
} else {
return false;
}
}
if(strTimeFormat.equals("24")) {
return true;
} else {
return false;
}
}
time.setText((new SimpleDateFormat("hh:mm")).format(new Date(message.msgTime)));
以上就是一對一視訊聊天APP源碼根據系統顯示時間的相關代碼, 更多内容歡迎關注之後的文章