Android Studio使用相关
在cd的统治下我学了as(我的十一长假qwq
Android Studio 在真机上执行Log.v和Log.d 不显示打印
1.进入拨号界面输入:*#*#2846579#*#*
2.进入“后台设置” ——>“LOG设置”
3.点击选择“AP日志“
Android Studio layout文件的preview不更新 并且报错:Failed to load AppCompat ActionBar with unknown error.
1.在AndroidManifest.xml
中找到theme对应的文件及theme名(例如我的是style/Apptheme)
2.进入style.xml
文件中找到 <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
3.在Theme.AppCompat.Light.DarkActionBar
前面添加Base.
,即改为<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
4.即可
Toast不显示
- 后面有没有加
.show()
(很多次这样了2333
log 报错:Failure getting entry for xxx
- 较大可能是找不到资源,查看是不是所有的文件都有放
- 我的是找不到图片,这两个都要放图片
实现文字可以复制
- 只需要TextView控件属性中增加:
android:textIsSelectable="true"
在安卓8等高版本中,http链接无法请求
- 在
res
文件夹下创建一个xml
文件夹,然后创建一个network_security_config.xml
文件,内容如下
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
- 在AndroidManifest.xml文件下的application标签增加以下属性:
<application
...
android:networkSecurityConfig="@xml/network_security_config"
...
/>
- 不过最好以后改用https的请求