Languages

Menu
Sites
Language
Exiting the App using the App_Id

Hello everyone, 

I am recently working on the App that can clear the Recent Apps from the recent app list,

I had a question that can I exit any running app using app_id of that application (App will be in pause mode while we exit from my app)

please help me for the above purpose, how should I exit some app using the app_id,

Note : I already have a list of the Apps in my Phone

 

Responses

1 Replies
Armaan-Ul- Islam

The Best Suggestion I can share is:

Check out the Sample app 'Task Manager' to Understand How They do it....

New > Sample > Mobile 3.0 > Native > AppFW > Task Manager

 

You may inspect the Complete Code Flow There.

 

And the code for Termination/kill resides on src>data.c, You may get Idea from here....

bool data_application_mgr_resume_app(char *app_id)
{
    app_context_h app_context = NULL;

	if (!app_id) {
		dlog_print(DLOG_ERROR, LOG_TAG, "Invalid parameter");
		return false;
	}

	if (app_manager_get_app_context(app_id, &app_context) != APP_MANAGER_ERROR_NONE) {
		dlog_print(DLOG_ERROR, LOG_TAG, "Failed to get app context");
		return false;
	}

	if (app_manager_resume_app(app_context) != APP_MANAGER_ERROR_NONE) {
		dlog_print(DLOG_ERROR, LOG_TAG, "Failed to resume app");
		return false;
	}

	if (app_context_destroy(app_context) != APP_MANAGER_ERROR_NONE) {
		dlog_print(DLOG_ERROR, LOG_TAG, "Failed to destroy context handle");
		return false;
	}

	return true;
}

 

Add the same privileges from Sample app. Same Code may work for Wearable, Unless there is any specific API support Issue.