语言

Menu
Sites
Language
How to keep current app state when appcontrol is launched in before Tizen 2.4

I'm writing a hybrid applicaiton for tizen wearables using the 2.3.1 SDK. In web side of the application I have a bunch of appcontrols defined and I'm launching these appcontrols from my native service. The thing is if service launch an appcontrol when the application is active current app state get lost.

So, how do i keep the current application state when appcontrol is launched? I see there is a reload attribute intruduced for appcontrols in Tizen 2.4 but how to do this for older versions ?

响应

2 回复
Iqbal Hossain

hi Onur Şahin

You can store your app state in Shared Preference and can retreive these from another app. I think this will solve your problem of loosing app state. 

Follow these

1. https://developer.tizen.org/development/api-tutorials/native-application/application-framework/application/preference

2. https://developer.tizen.org/dev-guide/2.4/org.tizen.tutorials/html/native/app_framework/preference_tutorial_n.htm

-thanks

Onur Şahin

Hi, thanks for your answer. Well, I gave a try to your idea. Instead of using the service to access preference, I used localStorage tho. It is working for most of the part but the problem is if user terminates my app, I get no chance to update my app state in the localStorage so when appcontrol gets launched it checks there is an old app state in there and load's it. Unless there is a terminated event (like there is one in native apps) that I miss, this won't work.