安卓开发遇坑记录

Android10(API 29)getExternalStorageDirectory没权限

在AndroidManifest.xml文件中application节点中加上android:requestLegacyExternalStorage="true"属性就可以了,如下:

<application
    android:requestLegacyExternalStorage="true"

参考官方文档:  https://developer.android.google.cn/training/data-storage/compatibility

andoird studio 运行的模拟器跑到了侧边栏,Emulator,想让他单独运行

This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.

Toolbar toobar = findViewById(R.id.toolbar);
setSupportActionBar(toobar);

取消主题的bar样式

方法1

values/styles.xml 

<resources>
    <style name="FruitActivityTheme" parent="Theme.AppCompat">
        <item name="android:statusBarColor">@android:color/transparent</item>
<!--        新增代码↓↓↓↓↓↓↓↓↓↓↓↓↓-->
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>
</resources>

方法2

修改style标签的 parent 属性,为无 actionBar 的主题

<style name="Theme.MaterialTest" parent="Theme.MaterialComponents.DayNight.NoActionBar">

 Minimum supported Gradle version is 6.5. Current version is 6.1.1. If using the gradle wrapper...

我尝试着新建了一个项目然后吧所有的 

classpath 'com.android.tools.build:gradle:4.1.1'替换了一遍还是没有效果,
最后发现这个项目中缺少了 gradle 文件,于是将 新项目中的gradle目录复制进去
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

SUNbrightness

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值