使用Appcelerator的钛Android的返回键退出应用Appcelerator、Android

2023-09-05 07:41:06 作者:爱,不是我们说爱就爱

我是新来的钛发展。在如果我们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.