I'm struggling to get choosen image url paths, but reply.length is always 1 no matter how many images are chosen.
How to solve the issue?
var array = [];
try {
var appControl = new tizen.ApplicationControl(
"http://tizen.org/appcontrol/operation/pick",
null,
"image/*",
null, [new tizen.ApplicationControlData("http://tizen.org/appcontrol/data/selection_mode", ["multiple"])]);
var appControlReplyCallback = {
onsuccess: function(reply) {
for (var i = 0; i < reply.length; i++) {
if (reply[i].key === "http://tizen.org/appcontrol/data/selected") {
array.push(reply[i].value[0]);
}
}
},
onfailure: function() {
console.log("The launch application control failed");
}
};
tizen.application.launchAppControl(
appControl,
null,
function() {
console.log("launch application control succeed");
},
function(e) {
console.log("launch application control failed. reason: " + e.message);
},
appControlReplyCallback
);
} catch (e) {
alert("Error " + e.name + " : " + e.message);
}