如果在使用Titanium.Android.currentActivity.finish()关闭应用程序后从任务栏重新启动,该应用程序将冻结。[英] app will freeze if re-launch from the task bar after closing it using Titanium.Android.currentActivity.finish();

本文是小编为大家收集整理的关于如果在使用Titanium.Android.currentActivity.finish()关闭应用程序后从任务栏重新启动,该应用程序将冻结。的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

任何人都知道任何解决方法? 我们通过调用此行代码Titanium.Android.currentActivity.CurrentActivity.CurrentActivity.Cinish()当用户点击后按钮(设备返回)来关闭应用程序.虽然应用程序将完全关闭,但如果用户尝试使用最近的应用程序重新启动应用程序(任务栏),则应用程序将冻结影响设备性能的影响.

我创建了一个新的应用程序,测试了它并能够复制问题.

任何人都知道一项工作?

步骤:
1.创建一个应用程序
2.在index.xml中创建一个窗口
3.添加事件侦听器并在index.js上打开窗口

$.container.addEventListener('androidback', function(){
    Titanium.Android.currentActivity.finish();
});

$.container.open();

操作系统信息:
输入图像描述

当我在另一个答案中描述时,我解决了问题 appcelerator应用程序不重新启动(Android)

在tiapp.xml中添加以下属性

<property name="ti.android.root.reappears.restart" type="bool">true</property>

在<ti:app>标签的根目录

其他推荐答案

问题是使用SDK 6.0.0解析的. 只需要重新编译现有模块,使其与所述SDK版本兼容.

本文地址:https://www.itbaoku.cn/post/1938228.html

问题描述

anyone knows any workaround? We are closing the application by calling this line of code Titanium.Android.currentActivity.finish() when the user tap the back button(device back). Though the application will close completely, if the user tried to re-launch the app using the recent apps(task bar), the application will freeze that affects device performance.

I created a new app, tested it and was able to replicate the issue.

Anyone knows a work-around?

Steps:
1. Create an app
2. Create a window in index.xml
3. add event listener and open the window on your index.js

$.container.addEventListener('androidback', function(){
    Titanium.Android.currentActivity.finish();
});

$.container.open();

OS Info:
enter image description here

推荐答案

I solved the problem as I described in another answer Appcelerator app doesn't restart (Android)

Add the following property in tiapp.xml

<property name="ti.android.root.reappears.restart" type="bool">true</property>

in the root of the <ti:app> tag

其他推荐答案

The issue was resolved using SDK 6.0.0. Just need to re-compile existing modules to make it compatible with the said SDK version.