0

So I want that when an activity is started ex:myactivity, it should get the names of all the applications that are launcher activities(ex:apex, nova,etc.) and list them. Is there any way to do that? I wan that my app should search for this and show a list of apps that can be set as default home launchers just like default app manager does.

<action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.HOME" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.LAUNCHER" />

Default App Manager
Nova Launcher

Now how do I make it so that when a button is clicked the setting activity for the current default launcher is opened? We can do that in Default App Manager so I know its possible but I am unable to get to it.

4

1 回答 1

3

您可以通过执行以下操作检索已安装应用程序的列表(将 HOME 作为类别):

Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_HOME);
List pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);
于 2013-07-04T16:22:07.260 回答