栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

安卓学习专栏——安卓报错As of Android 12, android:exported must be set; use true to make the activity availab

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

安卓学习专栏——安卓报错As of Android 12, android:exported must be set; use true to make the activity availab

步骤
  • 系列文章
  • 前言
    • 1.报错效果
    • 2.api解析
    • 3.解决方法
  • 总结

系列文章

提示:转到安卓学习专栏,观看更多内容!
点我直达–>安卓学习专栏


前言

报错:As of Android 12, android:exported must be set; use true to make the activity available to other apps, and false otherwise. For launcher activities, this should be set to true.


1.报错效果


2.api解析

安卓sdk版本31新增了新特性。
android:exported 是Android中的四大组件 Activity,Service,Provider,Receiver 四大组件中都会有的一个属性。
比如说android:exported在AndroidManifest.xml下的

android:exported="true"

在Activity中该属性用来标示:当前Activity是否可以被另一个Application的组件启动:true允许被启动;false不允许被启动。
作用是:是否支持其它应用调用当前组件。


3.解决方法

根据你的需要——
加上

android:exported="true"

或是加上

android:exported="true"


总结

大家喜欢的话,给个,点个关注!继续跟大家分享敲代码过程中遇到的问题!


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/602482.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号