本文主要包含android hbuilder,hbuilder,hbuilder 教程,hbuilder视频教程,hbuilder网页制作等相关知识,教程希望在学习及工作中可以帮助到您
");
</div>
- Date.prototype.Format = function (fmt) {
- var o = {
- "M+": this.getMonth() + 1, //月份
- "d+": this.getDate(), //日
- "h+": this.getHours()%12==0?12:this.getHours()%12, //小时
- "H+": this.getHours(),
- "m+": this.getMinutes(), //分
- "s+": this.getSeconds(), //秒
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
- "f": this.getMilliseconds() //毫秒
- };
- if (/(y+)/.test(fmt))
- fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
- for (var k in o)
- if (new RegExp("(" + k + ")").test(fmt))
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
- return fmt;
- }
- function getCallLog() {
- var content="";
- try{
- document.getElementById("output").innerHTML="";
- var CallLog = plus.android.importClass("android.provider.CallLog");
- var main = plus.android.runtimeMainActivity();
- var obj = main.getContentResolver();
- plus.android.importClass(obj);
- //查询
- var cursor = obj.query(CallLog.Calls.CONTENT_URI, null, null, null, null);
- // var SimpleDateFormat = plus.android.importClass("java.text.SimpleDateFormat");
- // var Date = plus.android.importClass("java.util.Date");
- // var Long = plus.android.importClass("java.util.Long");
- plus.android.importClass(cursor);
- var count = 0;
- var arr=[];
- if (cursor.moveToFirst()) {
- while (cursor.moveToNext()) {
- count++;
- //号码
- var number = cursor.getString(cursor.getColumnIndex(CallLog.Calls.NUMBER));
- //呼叫类型
- var