How to launch the gallery application and use the image data?
■ Summary
This code shows how to launch the gallery application and use the image data.
If user selects the image, the image will be displayed as the background image of HomeScreen.
This code shows how to launch the gallery application and use the image data.
If user selects the image, the image will be displayed as the background image of HomeScreen.
function launchImageGallery(type) {
var appControl = new tizen.ApplicationControl(
"http://tizen.org/appcontrol/operation/pick",
null,
"image/png",
null);
var appControlReplyCallback = {
// callee sent a reply
onsuccess: function(data) {
tizen.systemsetting.setProperty(type, data[0].value[0], function(){}, function(){});
},
// callee returned failure
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);
}
//Initialize function
var init = function() {
launchImageGallery("HOME_SCREEN");
};
window.onload = init;