android Launcher3设置默认桌面应用
作者:大木头_ 时间:2022-07-20 20:18:42
android Launcher3 设置默认桌面应用,供大家参考,具体内容如下
launcher3 的默认桌面应用是在 res/xml里
默认有4种样式
default_workspace_3x3.xml
default_workspace_4x4.xml
default_workspace_5x5.xml
default_workspace_5x6.xml
我们看看default_workspace_3x3.xml
<?xml version="1.0" encoding="utf-8"?>
<favorites xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3">
<!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
<!-- Messaging, [All Apps], Dialer -->
<resolve
launcher:container="-101"
launcher:screen="0"
launcher:x="0"
launcher:y="0" >
<favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MESSAGING;end" />
<favorite launcher:uri="sms:" />
<favorite launcher:uri="smsto:" />
<favorite launcher:uri="mms:" />
<favorite launcher:uri="mmsto:" />
</resolve>
<!-- All Apps -->
<resolve
launcher:container="-101"
launcher:screen="2"
launcher:x="2"
launcher:y="0" >
<favorite launcher:uri="#Intent;action=android.intent.action.DIAL;end" />
<favorite launcher:uri="tel:123" />
<favorite launcher:uri="#Intent;action=android.intent.action.CALL_BUTTON;end" />
</resolve>
<!-- Bottom row -->
<resolve
launcher:screen="0"
launcher:x="0"
launcher:y="-1" >
<favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_EMAIL;end" />
<favorite launcher:uri="mailto:" />
</resolve>
<resolve
launcher:screen="0"
launcher:x="1"
launcher:y="-1" >
<favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_GALLERY;end" />
<favorite launcher:uri="#Intent;type=images/*;end" />
</resolve>
<resolve
launcher:screen="0"
launcher:x="2"
launcher:y="-1" >
<favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MARKET;end" />
<favorite launcher:uri="market://details?id=com.android.launcher" />
</resolve>
<!-- Second last row -->
<resolve
launcher:screen="0"
launcher:x="0"
launcher:y="-2" >
<favorite launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_BROWSER;end" />
<favorite launcher:uri="http://www.example.com/" />
</resolve>
<resolve
launcher:screen="0"
launcher:x="2"
launcher:y="-2" >
<favorite launcher:uri="#Intent;action=android.media.action.STILL_IMAGE_CAMERA;end" />
<favorite launcher:uri="#Intent;action=android.intent.action.CAMERA_BUTTON;end" />
</resolve>
</favorites>
几个属性说明
<resolve
launcher:container="-101"//-101应该代表是hotseat,也就是说此应用将处于hotseat里
launcher:screen="0"//应用所处屏幕
launcher:x="0"//应用图标所处x位置
launcher:y="0" >//应用图标所处y位置
<favorite //标明这是快捷方式
launcher:className="com.android.dialer.DialtactsActivity"//点击图标启动的类
launcher:packageName="com.android.dialer" //应用包名 />
</resolve>
其他说明
x,y,screen
来源:https://%bcnet%/yxdspirit/article/details/78492487/
标签:android,Launcher3,默认桌面
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
javaweb实现app扫码登录功能
2022-03-25 03:48:19
java设计模式:建造者模式之生产线
2023-11-04 10:47:24
![](https://img.aspxhome.com/file/2023/6/115976_0s.png)
Android中 视频屏幕左半部分上下滑动改变亮度右半部分上下滑动改变声音
2021-08-13 02:57:12
C#使用Aforge调用摄像头拍照的方法
2022-02-10 02:34:36
![](https://img.aspxhome.com/file/2023/9/96369_0s.png)
java中functional interface的分类和使用详解
2021-09-15 15:59:20
c# 委托和事件实例学习
2023-07-04 06:25:58
Android组件banner实现左右滑屏效果
2023-11-01 17:54:59
![](https://img.aspxhome.com/file/2023/8/93258_0s.jpg)
图文详解OkHttp的超时时间
2022-05-14 13:50:23
![](https://img.aspxhome.com/file/2023/6/71636_0s.png)
Android开发之搜索框SearchView用法示例
2021-10-30 03:40:19
![](https://img.aspxhome.com/file/2023/2/137282_0s.gif)
Android App自动更新之通知栏下载
2023-11-07 16:56:45
Spring JPA联表查询之OneToMany源码解析
2023-12-25 06:10:47
C# HttpClient 如何使用 Consul 发现服务
2021-09-28 01:06:18
![](https://img.aspxhome.com/file/2023/8/111198_0s.png)
国内分布式框架Dubbo使用详解
2022-05-10 13:38:27
![](https://img.aspxhome.com/file/2023/3/71883_0s.jpg)
Android人脸识别Demo竖屏YUV方向调整和图片保存(分享)
2022-11-24 00:47:42
![](https://img.aspxhome.com/file/2023/7/138517_0s.jpg)
Java中自动装箱、拆箱引起的耗时详解
2023-01-11 11:42:42
java 中sendredirect()和forward()方法的区别
2021-11-07 18:39:28
C/C++ Qt 基本文件读写的基本使用(2种实现)
2021-09-17 05:15:36
Java如何使用Optional与Stream取代if判空逻辑(JDK8以上)
2022-01-15 02:52:53
SpringBoot如何整合redis实现过期key监听事件
2023-08-04 18:51:19
![](https://img.aspxhome.com/file/2023/8/57808_0s.png)
C#中使用闭包与意想不到的坑详解
2022-08-15 00:13:58
![](https://img.aspxhome.com/file/2023/8/116618_0s.png)