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

查看:17
本文介绍了如果在使用 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.

有人知道解决方法吗?

步骤:
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天全站免登陆