我正在從手機讀取聯繫人的Android應用程序(phonegap),它在Android 5及以上版本可以正常工作,但是當涉及到Android 4操作系統它不能夠從手機上讀取聯繫人,所以我想詢問是否有人遇到過這個問題,同時在手機中使用contacts.find。contacts.find doesnt工作和andriod 4(phonegap)
document.addEventListener("deviceready", onDeviceReady, true); //the onDeviceReady function takes place when the app starts
function onDeviceReady() {
// find all contacts displayName, Name and phoneNumbers
var fields = ["displayName", "name", "phoneNumbers"];
var options = new ContactFindOptions();
options.filter = "";
options.multiple = true;
navigator.contacts.find(fields, onSuccess, onError, options);
\t var currentdate = new Date();
var datetime = currentdate.getDate() + "-"+(currentdate.getMonth()+1)
+ "-" + currentdate.getFullYear() + "T" + currentdate.getHours() + ":"
+ currentdate.getMinutes() + ":" + currentdate.getSeconds();
\t alert(datetime);
} \t
你能後的代碼片段? –
剛剛發佈了它 –