语言

Menu
Sites
Language
Getting result from APP_CONTROL_OPERATION_CREATE_CONTENT

Hi

Im launching a camera  to take photo and use the saved photo. But i am not able to get the path of the saved image file from the app_control_reply_cb.

 

#define IMAGE_MIME_TYPE "image/*"

app_control_create(&app_control);
app_control_set_operation(app_control, APP_CONTROL_OPERATION_CREATE_CONTENT);
app_control_set_mime(app_control, IMAGE_MIME_TYPE);

if (app_control_send_launch_request(app_control, file_select_result_cb, NULL) == APP_CONTROL_ERROR_NONE)
{
       dlog_print(DLOG_DEBUG, LOG_TAG_FACEBOOK, "Succeeded to launch a viewer app.");
}

After taking the picture and saving it,  "file_select_result_cb"  is called.

        ret = app_control_get_extra_data(reply, APP_CONTROL_DATA_SELECTED, &value);
        if ( ret == APP_CONTROL_ERROR_NONE)
        {
            dlog_print(DLOG_DEBUG, LOG_TAG_FACEBOOK, "[app_control_result_cb] Succeeded: value(%s)", value);
        }

Here im getting the following error.

[app_control_extra_data_cb] Failed: key(http://tizen.org/appcontrol/data/selected), Error code: -126

Please help

 

响应

4 回复
Jean Yang

Hi,

do you add the priviliege such as media stroge, or external storage?

Sundar Jeyaram

yes privileges are already added. APP_CONTROL_OPERATION_PICK is working fine. 

Having problem only with APP_CONTROL_OPERATION_CREATE_CONTENT.

Vikram

Hi,

error code: -126, means the key APP_CONTROL_DATA_SELECTED not exist as your code.

TIZEN_ERROR_KEY_NOT_AVAILABLE = -ENOKEY, /**< Required key not available */

#define    ENOKEY        126    /* Required key not available */

try to foreach the extra data key by app_control_foreach_extra_data() .

 

Also, suggest you to check this similar issue, https://developer.tizen.org/forums/native-application-development/getting-result-filemanager

Sundar Jeyaram

hi

im trying with "app_control_foreach_extra_data". 

Log for APP_CONTROL_OPERATION_CREATE_CONTENT

 

[app_control_extra_data_cb] Failed: key(http://tizen.org/appcontrol/data/selected), Error code: -126

 

Log for APP_CONTROL_OPERATION_PICK

 

[app_control_extra_data_cb] Succeeded: key(path), value(/opt/usr/media/DCIM/Camera/20150711-091513.jpg)
[app_control_extra_data_cb] Failed: key(http://tizen.org/appcontrol/data/selected), Error code: -126

In both the cases APP_CONTROL_DATA_SELECTED  is failed. Do we need to add this key for APP_CONTROL_OPERATION_CREATE_CONTENT?

After taking the photo and clicked DONE , i got this log

07-15 14:54:05.876 : WARN / IV-SAVE ( 14276 : 14276 ) : 0:00:26.602[F:ivug-save-view.c L:   58][b4f59000][HIGH] pSaveView(0xb769f4b0). Done clicked.
07-15 14:54:05.876 : ERROR / IV-APP ( 14276 : 14276 ) : image-viewer.c: _ug_result_cb(632) > [_ug_result_cb : 00632]UG Result CB. UG=0xb76723a8 Priv=0xbec7cea8
07-15 14:54:05.876 : ERROR / IV-APP ( 14276 : 14276 ) : image-viewer.c: _iter_extra_data_cb(300) > [_iter_extra_data_cb : 00300]single data  Result : Ok
07-15 14:54:05.876 : WARN / CAPI_APPFW_APP_CONTROL ( 14276 : 14276 ) : app_control.c: app_control_error(135) > [app_control_get_extra_data] KEY_NOT_FOUND(0xffffff82)
07-15 14:54:05.876 : ERROR / IV-APP ( 14276 : 14276 ) : image-viewer.c: _ug_result_cb(656) > [_ug_result_cb : 00656]app_control_get_extra_data ivug.status failed, [Specified key not found]
07-15 14:54:05.876 : WARN / CAPI_APPFW_APP_CONTROL ( 14276 : 14276 ) : app_control.c: app_control_error(135) > [app_control_get_extra_data] KEY_NOT_FOUND(0xffffff82)