Android权限检测和动态申请,没有权限则退出程序:
解决方案:
文件: AndroidManifest.xml (放在和application同级就可以)
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission
在学习Android数据绑定ImageView开发时,出现类似以下错误:
Cannot find a setter for <android.widget.ImageView android:srcCompat> that accepts parameter type 'androidx.lifecycle.MutableLiveData<android.graphics.drawable.Drawable>'
If a binding
刚刚接触Android开发,想做一个列表下拉更新的功能,网上一搜,很多都是用户自定义的,我需要的功能很简单,后来发现谷歌的SwipeRefreshLayout可以实现;
在layout文件里使用android.support.v4.widget.SwipeRefreshLayout类,在build.gradle文件的dependencies中添加implementation "androidx.swiperefreshlayout:swiperefresh