语言

Menu
Sites
Language
How to check if application is in foreground/background?

Hi,

Is there any event that is fired when Tizen Web application goes to background/foreground? I need to update the page when app comes back to foreground.

Thanks,

Jan

编辑者为: Brock Boland 17 3月, 2014 原因: Paragraph tags added automatically from tizen_format_fix module.

响应

5 回复
Lakshmi Grandhi
Hi Jan, Current SDK doesn't support such event, i will check with developement team whether they support in SDK 2.0
Jan Macura
Hi, I am using Tizen SDK 2.0.0a. Is there a new public SDK already?
jezra
you can use page visibility. The spec is at http://www.w3.org/TR/page-visibility/ for example: document.addEventListener("visibilitychange", visibilityChanged); function visibilityChanged() { if ( document.hidden ) { cosole.log('app is in the background'); } else { cosole.log('app is in the foreground'); } }
Jan Macura
Yes, I have used this as a backup solution, but I hoped that there will be something more sophisticated in tizen ;)
jezra
What's wrong with simplicity?