Android Manifest标签之action, activity-alias, category和compatible-screens

本文详细介绍了AndroidManifest.xml中action, activity-alias, category和compatible-screens四个关键元素的用法和属性。action用于定义Intent过滤器,activity-alias提供Activity的别名,category指定Intent类别,而compatible-screens则用于声明应用支持的屏幕尺寸和密度。理解这些元素对于优化Android应用的启动和兼容性至关重要。" 139559039,11259900,YOLOv8_obb实战:训练、验证与预测旋转目标检测,"['目标检测', 'YOLO', '旋转目标', '数据集构建', '深度学习']
摘要由CSDN通过智能技术生成

<action>

语法: 

<action android:name="string"/>

 

父标签:

<intent-filter>

描述:

每个<intent-filter>标签都必须有一个或者更多的<action>标签, 如果没有的话, 就不会有符合该intent-filter的intent了.

属性:

android:name.唯一的属性, 表示action的名字, 在intent类中有些默认的action名字, 格式为”ACTION_string”. 而在action:name中则使用”android.intent.action.string”来对应intent中的action. 比如: intent参数中的ACTION_MAIN对应android:name的android.intent.actioin.MAIN,用ACTION_WEB_SEARCH对应android.intent.action.WEB_SERACH.对于自定义的action, 最好使用包名做前缀, 以防止重名, 比如一个叫TRANSMOGRIFY的action可以定义成这样:

<action android:name="com.example.project.TRANSMOGRIFY"/>

<activity-alias>

语法:

<activity-alias android:enabled=["true" | "false"]
                android:exported=["true" | "false"]
                android:icon="drawable resource"
                android:label="string resource"
                android:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值