Follow

Switch navigation to background and foreground example

Description

To put Sygic into background we use the API function bringApplicationToBackground().
To put Sygic into foreground we use the API function show(). The function show also starts the navigation if it is not started.
In case it is started the function brings the navigation into foreground with the setting the parameter to false. Setting parameter to true should start the navigation to background, but this behavior is deprecated for Android. The example shows toggling the navigation to background and foreground based on the value of the variable fg

Java

                import com.sygic.sdk.remoteapi.Api;
                ...
                private boolean fg = true;
                ...
		    	try {
					if (fg == true)
					{
					    mApi.show(false);
					}
					else
					{
						mApi.bringApplicationToBackground();
					}
				} catch (RemoteException e) {
					e.printStackTrace();
				}
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments