单击移动设备的硬件按钮,然后它应该退出 TIZEN 应用程序 [英] On click of hardware button of mobile then it should exit from TIZEN application

查看:32
本文介绍了单击移动设备的硬件按钮,然后它应该退出 TIZEN 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了 tizen 应用程序,我想使用硬件按钮,一旦用户点击硬件按钮,它应该从应用程序中退出.我正在开发 TIZEN应用程序.我的应用程序的硬件后退按钮不起作用.

I have developed tizen application and i want to use hardware button,once user click on hardware button it should exit from application.I am developing TIZEN application.The hardware back button of my application is not working.

推荐答案

TIZEN (2.3) 中有两种类型的应用程序

There are two type of application is exist in TIZEN (2.3)

如果您制作网络应用程序,

If you make web application,

document.addEventListener('tizenhwkey', function(e) {
    if(e.keyName == "back") {
        try {
            tizen.application.getCurrentApplication().exit();
        } catch (error) {
            console.error("getCurrentApplication(): " + error.message);
        }
    }
});

但是如果你想要原生应用程序,你可以通过 EFL 扩展 API

but if you want native application, you can get back button event with EFL Extension API

#include <efl_extension.h>

static void
win_back_cb(void *data, Evas_Object *obj, void *event_info)
{
    appdata_s *ad = data;
    /* Let window go to hide state. */
    elm_win_lower(win);
}

eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);

这篇关于单击移动设备的硬件按钮,然后它应该退出 TIZEN 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆