天天看点

一对一视频聊天APP源码,根据系统显示时间

一对一视频聊天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源码根据系统显示时间的相关代码, 更多内容欢迎关注之后的文章

继续阅读