com.lampa.startapp
com.lampa.startapp copied to clipboard
Different results when using package param to start app
I have an old application which use package name to check app and start app. I found that some apps can be started with package and some are not. For example,
In App A, I check the app is installed in the device and start app is succeeded. In App B, I also check the app is installed but cannot start app and receive android.content.ActiveityNotFoundException: No Activity found to handle Intent ( package name }.
Although I am able to use application and intentstart to start app, what is the reason of above problem?
@StephenMok1997 Hmm, if you use package
for start app, you need add to command name of activity or action because package
its not a intent for start app, its only package name. And that to start app with package name, we need to add action with this package, exam:
var sApp = startApp.set({
"action":"ACTION_MAIN",
"package":"com.lampa.startapp"
});
But if we need only start app with package name, without action or activity, we need to use parameter application
:
var sApp = startApp.set({
"application":"com.application.name"
}).start();
So any possible reason that some app can start and some app cannot?
@StephenMok1997 error indicates that the main activity not found in the application (perhaps for <action android: name = "android.intent.action.MAIN" />
)! Does the application open through the device interface?
What do you mean by device interface?
What do you mean by device interface?
Android Launcher
@StephenMok1997 error indicates that the main activity not found in the application (perhaps for
<action android: name = "android.intent.action.MAIN" />
)! Does the application open through the device interface?
No
@StephenMok1997 error indicates that the main activity not found in the application (perhaps for
<action android: name = "android.intent.action.MAIN" />
)! Does the application open through the device interface?No
So you need to get the package name and the activity name of application for start application, example:
var sApp = startApp.set({
"component": ["com.app.name","com.app.name.QrScannerActivity"]
}).start();
You can get package name and activity name by decompiling application and looking at its AndroidManifest.xml
👀🤷