随笔分类 - android
平时遇到的小问题
摘要:在project的build.gradle里添加google(),如下图:
阅读全文
摘要:目前Andorid主流的图片处理库框架之一,在Anroid图片处理中需要考虑的问题很多,例如OOM、图片缓存和网络图片加载、多线程问题及图片压缩处理等等负责的问题。但是Universal-imageLoader以及帮我们把这些问题处理好了,且对外提供了相应完善的请求API,我们只需要按照要求使用即可
阅读全文
摘要:1. 在build.gradle(Module)的dependency(dependencies)添加引用: compile 'com.android.support:recyclerview-v7:25.3.1 2. 在布局中添加recyclerview
阅读全文
摘要:1. 权限动态申请,最好在manifests中也加上静态权限。//veiw的点击事件public void choosePicture(View view){// 判断SDK是否>=23 if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.M){// 判断是否已有权限 if (ContextCompat.checkSelfPermiss...
阅读全文
摘要:1. reference:参考某一资源ID。 (1)属性定义: <declare-styleable name = "名称"> <attr name = "background" format = "reference" /> </declare-styleable> (2)属性使用: <Image
阅读全文
摘要:1.在edittext编辑框中调用属性。2.创建一个drawable资源文件来设置,也可以直接用颜色设置。 3.监听edittext的焦点变化,获得焦点时将光标设置到最后的位置; @Override public void onFocusChange(View v, boolean hasFocus) { switch (v....
阅读全文
摘要:1. 创建ProgressDialog 法1: ProgressDialog dialog=ProgressDialog.show(this,"标题","内容","true","true"); // this这里是context环境,context最好是你要用的activity,其他环境有时候会造成
阅读全文
摘要:1.创建自己的主题样式(style) 在vules资源目录下的style中创建一个样式
阅读全文
摘要:// 昵称修改 弹出框popuwindowprivate void showNickPopuWindow(View view){ if (nickWindow==null){ View layout=LayoutInflater.from(this.getContext()).inflate(R.l
阅读全文
摘要:在androi中WIFI信息的获取可以通过系统提供的WIFI Service获取 WifiManager wifi_service = (WifiManager)getSystemService(WIFI_SERVICE); WifiInfo wifiInfo = wifi_service.getC
阅读全文
摘要:方法1: 在xml文件中设置 android:drawableLeft="@drawable/lock_open"android:drawableTop="@drawable/lock_open"android:drawableRight="@drawable/lock_open"android:d
阅读全文
摘要:java.lang.NoSuchMethodError: android.content.res.Resources.getDrawable/getColor 异常错误。 原因:Context类的getDrawable(res)/geColor(res)方法和Resources的getDrawabl
阅读全文