Android 10 Settings应用如何去掉一级菜单应用和通知

2021/10/7 23:15:49

本文主要是介绍Android 10 Settings应用如何去掉一级菜单应用和通知,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

代码路径:
packages/apps/Settingssrc/com/android/settings/core/gateway/SettingsGateway.java
packages/apps/Settingsres/xml/top_level_settings.xml
1、在/top_level_settings.xml布局文件中去掉已连接的设备选项

<Preference
     android:key="top_level_apps_and_notifs"
     android:title="@string/app_and_notification_dashboard_title"
     android:summary="@string/app_and_notification_dashboard_summary"
     android:icon="@drawable/ic_homepage_apps"
     android:order="-100"
     android:fragment="com.android.settings.applications.AppAndNotificationDashboardFragment"/>

2、在SettingsGateway.java文件中SETTINGS_FOR_RESTRICTED数组中屏蔽掉AppAndNotificationDashboardActivity

public static final String[] SETTINGS_FOR_RESTRICTED = {
  Settings.AppAndNotificationDashboardActivity.class.getName()
}


这篇关于Android 10 Settings应用如何去掉一级菜单应用和通知的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程