Search code examples
androidandroid-intentintentfilter

Android Intent Filter Hide Activities with Certain Category


Is it possible to make an intent that shows activities that are in the apps drawer but arent homescreen apps (e.g. GoLauncher) so i.e. it hides a certain category?

        final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
        mainIntent.removeCategory(Intent.CATEGORY_HOME); //Doesn't work
        mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
        [...]
        apps = packageManager.queryIntentActivities(mainIntent, 0);

With this code they still get listed...


Solution

  • No, sorry, there's no "not" operator with an Intent.