Languages

Menu
Sites
Language
Control Application visibility

Hi,

I want to launch one app from another but with a conditional check in the OnAppControlRequestReceived().

If the condition fails, I dont want to launch the second app.

Im able to get it working when the second app, to be launched in not running at all.

But when it is already running in the background and another app tries to launch it  without the conditional check getting satisfied, it still opens.

How to prevent this and make the second app remain in its previous state itself?

Are changes required in OnForeground() call?

Becase OnAppInitialised() gets called only for the first time of the app launch.

Please help me with this.

Thanks,

Priya

 

 

 

Responses

3 Replies
Alex Dem

Hi,
I don't know your app architecture and don't sure that I understand your question correctly :
But if you want avoid logic inside OnAppControlRequestReceived() if second app is in background still, you could set appropriate property using App-> OnBackground().
If app will be terminated after OnBackground() this data will be lost, otherwise you could use it for checking inside OnAppControlRequestReceived() .

p.s. fyi: OnForeground occurs always after first launch or after apps was moved from background to foreground.
also, from documentation: when the application receives the AppControl request on the background, OnAppControlRequestReceived() is invoked before UiApp::OnForeground().
Alexey.

Sathya Priya R

Hi Alex,

Thanks for your reply.

My requirement is I don't want OnForeground( ) to get called when the condition is not met in OnAppControlRequestReceived().

I understand that its a system architecture call.

But still, when the conditional check fails, could we stop, without terminating the app and avoid further execution?

Is there any api to do the same?

Thanks,
Priya

 

Alex Dem

Hi,
afaik there is no way to move native app to background forcibly.
I know way for Tizen web apps only (how to move itself to background):

var app = tizen.application.getCurrentApplication();
app.hide()

Alexey.