From 5e598759c0ac67de0f100bdb93c0df336eff1353 Mon Sep 17 00:00:00 2001 From: "s89.jang" Date: Thu, 30 Mar 2017 14:18:20 +0900 Subject: [PATCH] Add ApplicationManager.IsRunning() method Change-Id: I598ca2682582a3be4cf63cd5d4e69ce278d17358 Signed-off-by: s89.jang --- .../Tizen.Applications/ApplicationManager.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs index 25fe0c7..d134c10 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs @@ -317,6 +317,23 @@ namespace Tizen.Applications return app; } + /// + /// Returns if the specified application is running or not. + /// + /// The application Id. + /// Returns true if the given application is running, otherwise false. + /// Thrown when the given parameter is invalid. + public static bool IsRunning(string applicationId) + { + bool isRunning = false; + Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppManagerIsRunning(applicationId, out isRunning); + if (err != Interop.ApplicationManager.ErrorCode.None) + { + throw ApplicationManagerErrorFactory.GetException(Interop.ApplicationManager.ErrorCode.InvalidParameter, "Invalid parameter"); + } + return isRunning; + } + private static void RegisterApplicationChangedEvent() { Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None; -- 2.7.4