您的位置:首页 > 健康 > 养生 > Android13适配记录

Android13适配记录

2024/10/6 12:26:28 来源:https://blog.csdn.net/weixin_42142832/article/details/141022408  浏览:    关键词:Android13适配记录

多语言支持,此功能在国内被阉割

配置后在设置内可以选择

<?xml version="1.0" encoding="utf-8"?>
<locale-config xmlns:android="http://schemas.android.com/apk/res/android"><locale android:name="zh" /><locale android:name="en" /><locale android:name="tw" /><locale android:name="ar" /><locale android:name="de" /><locale android:name="es" /><locale android:name="fa" /><locale android:name="fr" /><locale android:name="it" /><locale android:name="ja" /><locale android:name="ko" /><locale android:name="ms" /><locale android:name="pl" /><locale android:name="pt" /><locale android:name="ru" /><locale android:name="sk" /><locale android:name="th" /><locale android:name="tr" /><locale android:name="vi" />
</locale-config>

拆分sd卡权限

把原来的storage权限拆分成image、audio、video三个权限。如果仅仅是操作图片,视频、语音没有操作文件类的,可以使用Android内置的图片选择器。

			String p;if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {p = Manifest.permission.READ_MEDIA_IMAGES;} else {p = Manifest.permission.READ_EXTERNAL_STORAGE;}

声明广告ID

如果接入了Google广告,需要声明广告ID权限

<uses-permission android:name="com.google.android.gms.permission.AD_ID" />

webview 废弃API

//  废弃      webSettings.setAppCachePath(appCachePath);替代      webSettings.setDatabasePath(appCachePath);//  废弃      webSettings.setAppCacheEnabled(true);
//        setAppCacheEnabled(false) 可以用setCacheMode(WebSettings.LOAD_NO_CACHE)替代。
//        setAppCacheEnabled(true) 可以用setCacheMode(WebSettings.LOAD_DEFAULT)替代      

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com