如何退出应用程序在window phone 8与phonegap 2.3 [英] How to exit an application in window phone 8 with phonegap 2.3

查看:124
本文介绍了如何退出应用程序在window phone 8与phonegap 2.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是如何退出应用程序在window phone 8与phonegap 2.3。
$ $ b我使用了navigatior.app.exit(),但它显示navigatior.app未定义。

My question is that how to exit an application in window phone 8 with phonegap 2.3.
I have used "navigatior.app.exit()",but it shows that "navigatior.app" is undefined.

推荐答案

    protected IsolatedStorageSettings UserSettings
    {
        get
        {
            return IsolatedStorageSettings.ApplicationSettings;
        }
    }
    void OnAppExit(object sender, EventArgs e)
    {
        UserSettings.Remove("sessionStorage");
        UserSettings.Save();
    }
    private void Page_BackKeyPress(object sender, CancelEventArgs e)
    {
        if (_browserHistoryLength > 1)
        {
            _phoneGapView.Browser.InvokeScript("eval", "history.go(-1)");
            _browserHistoryLength -= 2;
            e.Cancel = true;
        }
        else
        {
            //to exit app
            Application.Current.Exit += new EventHandler(OnAppExit);
           }
    }

这篇关于如何退出应用程序在window phone 8与phonegap 2.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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