关联类 1、RecyclerView.Adapter: 抽象类,为RecyclerView提供数据,一般根据不同的业务需求来编写具体的实现类。 2、RecyclerView.LayoutManager: 抽象类,主要用于测量RecyclerView的子Item,以及根据不同的布局方式来实现Item
Android 软键盘弹出时把控件布局顶出去的解决方法: 在Activity的onCreate中setContentView之前加入代码 getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
测试RecyclerView频繁刷新数据时,报出以下错误: java.lang.IllegalArgumentException Scrapped or attached views may not be recycled. isScrap:false isAttached:true 是指view
Android添加第三方so库的简单配置: android { compileSdkVersion 26 defaultConfig { ... ndk { //选择要添加的对应cpu类型的.so库。
使用ListView自定义Adapter时出现ArrayIndexOutOfBoundsException错误: java.lang.ArrayIndexOutOfBoundsException: length=2; index=2 at android.widget.AbsListView
BuildConfig.DEBUG Android开发中识别debug还是release状态还是很有用的,比如说打印日志,有些日志开发的时候需要,可是线上正式包不需要,这时知道debug状态就可以很方便的隐藏非必要日志而又不影响开发。 一般使用BuildConfig.DEBUG来获取应用的状态,de
dex2jar 官方链接:https://sourceforge.net/projects/dex2jar/ d2j-dex2jar classes.dex JD-GUI 官方链接:http://jd.benow.ca/ Apktool 官方链接:https://ibotpeaches.githu
在Activity中声明Handler类时,Android Studio会提示警告: This Handler class should be static or leaks might occur 例如这样的代码: public class MainActivity extends Acti
定义头文件 common.h #ifndef CZXING_COMMON_H #define CZXING_COMMON_H #include <jni.h> #ifdef NDK_DEBUG #define LOG_TAG "yezhou" #include
DrawerLayout是Support Library包中实现了侧滑菜单效果的控件,可以说DrawerLayout是因为第三方控件如MenuDrawer等的出现之后,Google借鉴而出现的产物。DrawerLayout分为侧边菜单和主内容区两部分,侧边菜单可以根据手势展开与隐藏(DrawerLa
简介 GSON是Google开发的Java API,用于转换Java对象和Json对象。 GitHub:https://github.com/google/gson 添加GSON依赖 方法一 1、点击菜单 File -> Project Structure,然后点击+号,选择Library
ButterKnife 简介 Github:https://github.com/JakeWharton/butterknife ButterKnife 优势: 1.强大的View绑定和Click事件处理功能,简化代码,提升开发效率 2.方便的处理Adapter里的ViewHolder绑定问题
Android开发中,AlertDialog使用相当频繁,基本是必须使用的 它的使用方法非常简单: alertDialog = newAlertDialog.Builder(mContext) .setTitle("提示") .setMessage("你
跳转拨打页面:Intent(Intent.ACTION_VIEW, Uri.parse("tel:10086")) 直接拨通电话:Intent(Intent.ACTION_CALL, Uri.parse("tel:10086")) //需要动态授权<u
布局配置 首先来看一下请的布局吧: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/ap