Launcher 过滤APP 显示

LA.UM.7.6.2/LINUX/android/packages/apps/Launcher3/src/com/android/launcher3/AppFilter.java 
old mode 100644
new mode 100755
index 923835a..72713ce
@@ -11,4 +11,7 @@ public class AppFilter {
 
     public boolean shouldShowApp(ComponentName app) {
+     if (app.getPackageName().equals("com.android.documentsui")) {                 
+         return false;            
+     }
         return true;
     }

Android中,可以通过检查应用程序的清单文件中的intent-filter来确定一个应用程序是否为启动器应用程序(LAUNCHER_APP)。一个具有以下清单文件的应用程序将被认为是启动器应用程序: ``` <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.launcherapp"> <application> <activity android:name=".LauncherActivity" android:label="@string/app_name"> <!-- This intent filter identifies this activity as the main entry point --> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> ``` 这里,我们使用了`android.intent.category.LAUNCHER`意图过滤器来标识此应用程序作为启动器应用程序,因为该过滤器指示此活动为该应用程序的主要入口点。 如果您想在代码中编程检查一个应用程序是否为启动器应用程序,您可以使用PackageManager的getLaunchIntentForPackage()方法。如果返回的Intent对象包含`CATEGORY_LAUNCHER`类别,则该应用程序被认为是启动器应用程序。以下是一个示例: ``` PackageManager pm = getPackageManager(); Intent launchIntent = pm.getLaunchIntentForPackage("com.example.launcherapp"); Set<String> categories = launchIntent.getCategories(); if (categories != null && categories.contains(Intent.CATEGORY_LAUNCHER)) { // The app is a launcher app } else { // The app is not a launcher app } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值