查找系统应用程序的包和活动名称?
我如何在 motoblur 和 touchwiz 上查找系统应用程序的包名称和主要活动名称?我正在制作一个应用程序,但我希望它是通用的,而不仅仅是 Sense 和普通 android。我实际上并没有运行 touchwiz 或 motoblur 的手机,所以我不知道如何找到它们。谢谢
How would I go about finding the package names and main activity name for system apps on motoblur and touchwiz? I am making an app but I want it to be universal, not just Sense and stock android. I dont actually own a phone running touchwiz or motoblur so I am stumped on how to find them out. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请注意,您不应该通过包/类名称启动活动 - 系统应用程序因设备而异,并且活动类名称可能会随着应用程序更新而改变(我注意到 Google 地图曾经这样做过)。
另一个原因是用户可能更喜欢使用他们安装的其他应用程序来执行特定任务(例如我更喜欢使用第 3 方应用程序拍照)。
您应该通过系统定义的意图来调用应用程序。
Note that you should not start activities via package/class names - system apps vary from device to device AND activity class names might change with app updates (I noticed Google Maps did this once).
The other reason would be that users might prefer to use some other app they installed to do particular task (for example I prefer to take pictures with a 3rd party app).
You should invoke apps via system defined intents.
您需要收集有关手机上已安装应用程序的信息,然后浏览
列表
并搜索所需的活动ints.addCategory(Intent.CATEGORY_LAUNCHER);
<--- 这里您可以指定使用查询搜索的Intent
类型(清单中定义的其他应用程序的开发人员),可以通过CATEGORY_LAUNCHER
或CATEGORY_DEFAULT
,实际上主要活动的类型是CATEGORY_LAUNCHER
。以及列表中的简单迭代:
在此处查看有关常量和方法的更多信息:
http://developer.android.com/reference/android/content/pm /PackageManager.html
You need to gather info about installed apps on the phone than go through the
list
and search for desired activityints.addCategory(Intent.CATEGORY_LAUNCHER);
<--- Here you can specify what type ofIntent
(which the developer of the other app defined in the manifest) to search with the query, it can by eitherCATEGORY_LAUNCHER
orCATEGORY_DEFAULT
, actually the main activities are of typeCATEGORY_LAUNCHER
.And the trivial iteration in the list:
Check here for more info about constants and methods:
http://developer.android.com/reference/android/content/pm/PackageManager.html