使用Appcelerator的钛Android的返回键退出应用 [英] Back button exits application in android using appcelerator titanium

查看:128
本文介绍了使用Appcelerator的钛Android的返回键退出应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的钛发展。在如果我们preSS原生Android后退按钮只有当前的活动将被关闭,它会回到previous活动,但是当我preSS Android中的后退按钮采用钛它从应用程序退出。

I am new to Titanium Development. In Native android if we press back button only current activity will be closed and it will go back to the previous activity but when I press the back button in Android using Titanium it exits from the application.

我怎样才能改变这种行为?

How can I change this behaviour?

推荐答案

有两种类型,如窗口, 轻量级和重量级。如果您在钛的android一个轻量级的窗口不是在后退按钮preSS会存在从应用程序。

There are two types of windows like, lightweight and heavyweight. If you create a lightweight window in Titanium android than on back button press it will exist from your application.

您可以实现你想要创建重量级窗口的内容。你可以打开它的模态窗口创建钛重量级窗口。所以,把参数模式:当您创建一个新的窗口真。新的窗口将被创建为模态窗口(窗口重量级钛机器人)。再后,如果你将preSS后退按钮也不会从申请退出。

You can achieve what you want by creating heavyweight window. You can create heavyweight window in titanium by open it as modal window. So put the parameter modal:true when you create a new window. New window will be created as modal window (heavyweight window for titanium android). And then after if you will press back button it will not exit from application.

这篇关于使用Appcelerator的钛Android的返回键退出应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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