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

查看:138
本文介绍了如果使用Titanium.Android.currentActivity.finish()将其关闭后从任务栏重新启动,则该应用将冻结.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道有什么解决方法吗? 当用户点击后退按钮(设备后退)时,我们将通过调用以下代码行Titanium.Android.currentActivity.finish()关闭应用程序.尽管该应用程序将完全关闭,但是如果用户尝试使用最新的应用程序(任务栏)重新启动该应用程序,则该应用程序将冻结,从而影响设备性能.

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?

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

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:

推荐答案

该问题已使用SDK 6.0.0解决. 只需重新编译现有模块以使其与所述SDK版本兼容即可.

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.

这篇关于如果使用Titanium.Android.currentActivity.finish()将其关闭后从任务栏重新启动,则该应用将冻结.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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