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, ...
Adding Logging Support to Your Android Application 83 Adding Some Media Support to Your Application 84 Adding Location-Based Services to Your Application 88 Debugging Your Application on Hardware 90 ...
Launch and wait application to end (8KB)
how to use custom URL schemes to launch your application. It also discusses how to make use of the Media Player and Address Book. Chapter 13, Distributing Your Application This chapter talks about how...
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 ...
You will learn how to configure Hyperledger Fabric and become familiar with its architectural components. Using these components, you will learn to build private blockchain networks, along with the ...
Author Joseph Kong's goal is to make you smarter, not to teach you how to write exploits or launch attacks. You'll learn how to maintain root access long after gaining access to a computer and how to...
User control to launch web browser and jump to URL.
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 ...
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...
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 ...
how to filter and schedule containers over the cluster, launch them as services, handle containers as tasks. We’ll start defining a web service with Nginx, then we’ll deploy a mandatory Wordpress ...
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 ...
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首页的效果的小例子,可以参考参考
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 ...
How to enable and disable autocorrect keywords with syntax highlighting Insert Menu Commands UltraEdit includes several special insert functions under the Insert menu. You can use these functions to ...