Android Studio编程
臧初之
有时候,总想记录点什么东西
展开
-
[Android Studio 4.1]解决自定义广播接收不到的问题?
在通过《第一行代码》这本书自学安卓过程中,发现在5章,发送自定义广播部分,所有代码和书上敲得一样,但是运行却接受不到广播。最后发现,这是由Android 8.0 新特性导致的问题。解决途径:Android8 自定义广播接收不到的问题:https://blog.csdn.net/kongqwesd12/article/details/78998151应用到本人程序中:Button button=(Button)findViewById(R.id.button);button.setOnClickL原创 2020-12-01 21:06:06 · 1252 阅读 · 0 评论 -
[Android Studio 4.1]在使用碎片的单页双页模式时,不能建立2个同名称的布局
先在res目录下新建layout-large文件夹,即new》Dictionary,输入文件夹名称。再在这个文件夹中创建一个,与已存在的布局名称相同的布局,其具体做法:1、首先确认文件夹的名字是layout-large,而不是layout_large,下划线好像不行2、在layout-large上右键,选择new-layout resource file,而不是xml,就可以了参考博客:https://blog.csdn.net/weixin_43545911/article/details/889转载 2020-11-24 20:08:45 · 242 阅读 · 0 评论 -
[Android Studio 4.1]在一个线性布局(LinearLayout)中嵌套多个线性布局时出错
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding原创 2020-11-18 16:56:17 · 1966 阅读 · 0 评论