We can launch any application installed on a device with it's UID
rather using the name of the application .
- By this way we can prevent the name clashes.
- No need for searching for the full path of the application.
In mmp file:
LIBRARY apgrfx.lib // for RApaLsSession
LIBRARY apparc.lib // for CApaCommandLine, TApaAppInfo
Source code
// System Includes
#include <apgcli.h> // for RApaLsSession
#include <apacmdln.h> // for CApaCommandLine
// ...
// ----------------------------------------------------------------------------
// CMyUtility::LaunchAppL(const TUid aAppUid)
// Find the application with it's UID and if exists then launch the
// application to the foreground.
// ----------------------------------------------------------------------------
//
void CMyUtility::LaunchAppL(const TUid aAppUid) const
{
RApaLsSession apaLsSession;
User::LeaveIfError(apaLsSession.Connect());
CleanupClosePushL(apaLsSession);
TApaAppInfo appInfo;
TInt retVal = apaLsSession.GetAppInfo(appInfo, aAppUid);
if(retVal == KErrNone)
{
CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
cmdLine->SetExecutableNameL(appInfo.iFullName);
cmdLine->SetCommandL(EApaCommandRun);
User::LeaveIfError( apaLsSession.StartApp(*cmdLine) );
CleanupStack::PopAndDestroy(cmdLine);
}
else
{
// The application not found!
}
CleanupStack::PopAndDestroy(&apaLsSession);
}
分享到:
相关推荐
An application that demonstrates how to launch the built-in contact picker from within an activity. This sample also uses reflection to ensure that the correct version of the contacts API is used, ...
NeoStart-android_launch_application
标题“Launch and wait application to end (8KB)”指的是一个小型程序或者代码片段,其主要功能是启动一个应用程序并等待该程序执行结束。这个程序可能只有8KB大小,因此它可能是高度优化的,专注于核心功能,以...
product launch and its maintenance. It also plays an integral part in scaling an application out to support a wider user base. Apache JMeter is a free open source, cross-platform, performance testing ...
ACER宏基笔记本LaunchManager快捷键设置工具LaunchManager是ACER公司为其笔记本用户开发的快捷键设置工具,用户可以使用默认的程序启动热键,如ie、邮箱等,也可以自定义相关程序,实现快速启动,欢迎下载体验
If you are a .NET developer with an understanding of application development, but want to learn how to optimize the performance of your applications, this is the book for you. Basic knowledge of C# is...
Mini Alarms is an application by which the user can add, delete, modify, ... To launch this application when system starts, users can add a shortcut of this application to menu "Start->Startup".
You can launch the application with by running: $ ./gradlew bootRun This project uses kotlin-spring plugin to avoid requiring open modifier on proxified classes and methods, see this blog post for ...
Cramming_for_FISMA_How_to_Launch_a_NIST_800_53_Moderate_System_in_180_Days 业务风控 安全架构业务风控 企业安全 APT
Chapter 2, An Introduction to Kubernetes, discusses what Kubernetes is, what problems it solves, and also takes a look at its backstory, from internal engineering tool at Google to an open source ...
What You Will LearnDevelop containerized applications using the Docker version 17.03Build Docker images from containers and launch themDevelop Docker images and containers leveraging DockerfilesUse ...
- Select the "View-based Application" template to create a basic user interface along with a controller subclass. 3. **Defining a Model, View, and Controller (MVC):** This step involves ...
System administrators will learn how to integrate their favorite tools and processes, while developers will pick up enough system administration knowledge to build a robust and resilient AWS ...
【标题】:“动画小效果,模仿nice应用” 这个标题揭示了我们要探讨的知识点是关于创建一个类似Nice应用的动画效果。Nice是一款广受欢迎的社交应用,以其独特的用户体验和视觉设计吸引了大量用户。...
diffusion texture and if you understand all this graphical/mathematical stuff then its very good.<END><br>44,filedirector.zip This is an application I wrote to work in conjunction with the "Windows...
This is where this book comes in—its goal is to avoid bloating the reader with API references and framework descriptions, but to embrace a hands-on approach, helping the reader learn how to leverage ...