I have tried to write an Android application with an activity that should be launched from a different application. It is not a content provider, just an app with a gui that should not be listed among the installed applications. I have tried the code examples here and it seems to be quite easy to launch existing providers and so on, but I fail to figure out how to just write a "hidden" app and launch it from a different one.
The basic use case is:
I fail in the third step. Is it possible to do this?
Yes.
Use the package name and class name, like this (for starting Gmail):
new Intent("com.google.android.gm", "com.google.android.gm.ConversationListActivity");
Why do you want to use "package and class names" to launch the Activities in the second .apk
?
Why not use an Intent
since this is the standard way to launch an Activity
?
On the same lines, if I have an application that typically starts an activity, can I build it into an apk by signing it with a private key. Will this allow access to that activity from other apks build by other developers?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.