没有任何人有一个简单的code,以显示一个列表(列表视图?)所有安装在手机上的应用程序,并且点击时让用户打开一个?
Does anybody have a simple code to display a list (list view?) of all the apps installed on a phone, and have the user open one when clicked?
甚至是应用程序的抽屉。我只是需要一种方法来让用户打开的所有应用程序。
Or even an App drawer. I just need a way to have the user open all of their apps.
我试图寻找教程,但找不到任何和我下载的例子回家的Android,但我绝对讨厌翻翻code和挖掘出我想要的。
I have tried searching for tutorials, but couldn't find any, and I downloaded the example home from Android, but I absolutely hate looking through code and digging out what I Want.
有一个看的首页示例应用程序自带的SDK。
Have a look at the Home sample application that comes with the SDK.
的基本思想是使用 PackageManager 以获得任
The basic idea is to use PackageManager to get either
在所有安装的软件包使用 getInstalledPackages
或列表
使用 queryIntentActivities
与类别 CATEGORY_LAUNCHER
和行动 ACTION_MAIN
a list of all installed packages using getInstalledPackages
or
a list of all launcher activities using queryIntentActivities
for an intent with category CATEGORY_LAUNCHER
and action ACTION_MAIN
这取决于你的使用情况。
depending on your use case.