app will freeze if re-launch from the task bar after closing it using Titanium.Android.currentActivity.finish();

谁说我不能喝 提交于 2019-12-25 07:39:01

问题


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:


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/40990418/app-will-freeze-if-re-launch-from-the-task-bar-after-closing-it-using-titanium-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!