Android不显示开机向导和开机气泡问题
作者:Vico-H 时间:2022-10-13 23:56:26
修改好的代码下载地址:
https://github.com/Vico-H/Launcher
•不显示开机向导
--------------------------------------------------------------------------------
修改Launcher2.java的代码
(文件位置: /alps/packages/apps/Launcher2/src/com/android/launcher2/Launcher.java)
网站查看源码:
https://www.androidos.net.cn/android/6.0.1_r16/xref/packages/apps/Launcher2/src/com/android/launcher2/Launcher.java
Launcher2.java部分源码如下:
······
public void showFirstRunWorkspaceCling() {
// Enable the clings only if they have not been dismissed before
if (isClingsEnabled() &&
!mSharedPrefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, false) &&//此处false改为true
!skipCustomClingIfNoAccounts() ) {
// If we're not using the default workspace layout, replace workspace cling
// with a custom workspace cling (usually specified in an overlay)
// For now, only do this on tablets
if (mSharedPrefs.getInt(LauncherProvider.DEFAULT_WORKSPACE_RESOURCE_ID, 0) != 0 &&
getResources().getBoolean(R.bool.config_useCustomClings)) {
// Use a custom cling
View cling = findViewById(R.id.workspace_cling);
ViewGroup clingParent = (ViewGroup) cling.getParent();
int clingIndex = clingParent.indexOfChild(cling);
clingParent.removeViewAt(clingIndex);
View customCling = mInflater.inflate(R.layout.custom_workspace_cling, clingParent, false);
clingParent.addView(customCling, clingIndex);
customCling.setId(R.id.workspace_cling);
}
initCling(R.id.workspace_cling, null, false, 0);
} else {
removeCling(R.id.workspace_cling);
}
}
public void showFirstRunAllAppsCling(int[] position) {
// Enable the clings only if they have not been dismissed before
if (isClingsEnabled() &&
!mSharedPrefs.getBoolean(Cling.ALLAPPS_CLING_DISMISSED_KEY, false)) {//此处false改为true
initCling(R.id.all_apps_cling, position, true, 0);
} else {
removeCling(R.id.all_apps_cling);
}
}
public Cling showFirstRunFoldersCling() {
// Enable the clings only if they have not been dismissed before
if (isClingsEnabled() &&
!mSharedPrefs.getBoolean(Cling.FOLDER_CLING_DISMISSED_KEY, false)) {//此处false改为true
return initCling(R.id.folder_cling, null, true, 0);
} else {
removeCling(R.id.folder_cling);
return null;
}
}
······
修改如下:
- !mSharedPrefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, false) &&
+ !mSharedPrefs.getBoolean(Cling.WORKSPACE_CLING_DISMISSED_KEY, true) &&
- !mSharedPrefs.getBoolean(Cling.ALLAPPS_CLING_DISMISSED_KEY, false))
+ !mSharedPrefs.getBoolean(Cling.ALLAPPS_CLING_DISMISSED_KEY, true))
- !mSharedPrefs.getBoolean(Cling.FOLDER_CLING_DISMISSED_KEY, false))
+ !mSharedPrefs.getBoolean(Cling.FOLDER_CLING_DISMISSED_KEY, true))
•不显示开机气泡
--------------------------------------------------------------------------------
有个需求是开机不要下面这个图片所示的气泡
修改Launcher3.java的代码
(文件位置: /alps/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java)
网站查看源码:
https://www.androidos.net.cn/android/6.0.1_r16/xref/packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
Launcher3.java部分源码如下:
······
protected void onCreate(Bundle savedInstanceState) {
······
if (shouldShowIntroScreen()) {
showIntroScreen();
} else {
showFirstRunActivity();
showFirstRunClings();//注释此行即可
}
}
······
将下面的直接的这行注释掉就不会有开机气泡了
- showFirstRunClings();
+ //showFirstRunClings();
总结
以上所述是小编给大家介绍的Android不显示开机向导和开机气泡问题,希望对大家有所帮助,如果大家有任何欢迎给我留言,小编会及时回复大家的!
来源:https://www.cnblogs.com/Vico-H/archive/2019/05/12/10851366.html
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
C# 读写自定义的Config文件的实现方法
![](https://img.aspxhome.com/file/2023/5/91365_0s.png)
Jetpack Compose实现列表和动画效果详解
![](https://img.aspxhome.com/file/2023/3/103893_0s.png)
linux操作系统安装MONO执行C#程序的详解步骤
Spring cloud config 配置文件加密方式
Struts2实现文件上传时显示进度条功能
C#实现json的序列化和反序列化实例代码
Java并发编程之volatile与JMM多线程内存模型
![](https://img.aspxhome.com/file/2023/3/62203_0s.png)
深入浅出MappedByteBuffer(推荐)
Java语言之LinkedList和链表的实现方法
![](https://img.aspxhome.com/file/2023/0/83420_0s.png)
SpringBoot接口如何统一异常处理
![](https://img.aspxhome.com/file/2023/9/84309_0s.png)
详解Spring Data Jpa 模糊查询的正确用法
c# 将Datatable数据导出到Excel表格中
SpringBoot注入自定义的配置文件的方法详解
![](https://img.aspxhome.com/file/2023/2/66682_0s.png)
23种设计模式(19)java责任链模式
![](https://img.aspxhome.com/file/2023/7/89487_0s.jpg)
Android 自定义组件卫星菜单的实现
![](https://img.aspxhome.com/file/2023/4/113284_0s.jpg)
Android自定义StickinessView粘性滑动效果
![](https://img.aspxhome.com/file/2023/9/90179_0s.gif)
Flutter自定义圆盘取色器
![](https://img.aspxhome.com/file/2023/0/96010_0s.gif)
struts2自定义拦截器的示例代码
![](https://img.aspxhome.com/file/2023/3/78243_0s.jpg)