随笔分类 - android 开发
技术小白一只
摘要:首先初始化 private RecyclerView recycler_view; private MyAdapter mAdapter;//适配器 recycler_view = (RecyclerView) findViewById(R.id.recycler_view); //设置布局管理器
阅读全文
摘要:1.NoSuchMethodError: No virtual method getBytes(J)[B in class Lcom/huawei/kvdb/KVConnection; or its super classes (declaration of 'com.huawei.kvdb.KVC
阅读全文
摘要:我是参考这篇文章 :https://www.jianshu.com/p/dbc7e81aead2 主要是布局分横竖屏 然后再java代码 Configuration cf = this.getResources().getConfiguration(); int ori = cf.orientati
阅读全文
摘要:首先recyclerview适配器继承自RecyclerView.Adapter 不是之前的那个public class MyDetailsAdapter extends RecyclerView.Adapter {//设置常量 //平台 private static final int LEFT
阅读全文
摘要:获取到的bitmap剪切为圆形 private Bitmap createCircleBitmap(Bitmap resource) { //获取图片的宽度 int width = resource.getWidth(); Paint paint = new Paint(); //设置抗锯齿 pai
阅读全文
摘要:首先布局 因为我这个是列表所以这只是一个item <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width=
阅读全文
摘要://请求显示数据 private void getdata() { //开启线程来发起网络请求 new Thread(new Runnable() { @Override public void run() { try { 添加一个json格式数据 MediaType JSON = MediaTyp
阅读全文
摘要://最重要的就是加上这两个 主要作用 把获取到的图片地址转为url格式然后再转bitmap格式 private void displayImage(String imagePath) { BitmapFactory.Options options = new BitmapFactory.Option
阅读全文
摘要:要跳转的页 (返回后要刷新的页) MyFeedbackModel myFeedbackModel = myFeedback.get(position); Intent intent = new Intent(FeedbackList.this, FeedbackDetails.class); int
阅读全文
摘要:/** * 获取图标 bitmap * * @param context * Context.getExternalFilesDir(Environment.DIRECTORY_PICTURES)//android 10存储图片地址 */ public static synchronized Bit
阅读全文
摘要:第三方控件 :https://github.com/scwang90/SmartRefreshLayout 首先添加依赖 implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0' //布局 <com.scwang.smartr
阅读全文
摘要:recyclerview item布局<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_wi
阅读全文

浙公网安备 33010602011771号