• xutils3的使用


    1.添加依赖:compile 'org.xutils:xutils:3.5.0'


    2.清单文件中注册初始化
      初始化:x.Ext.init(this);
             x.Ext.setDebug(BuildConfig.DEBUG); // 是否输出debug日志, 开启debug会影响性能.//上线后参数设为false 将debug关掉

    3.使用utils3加载网络图片
       x.image().bind(image, "https://p.ssl.qhimg.com/t01d15b1004b11cb0a7.jpg");

    4.使用utils3加载本地动态图片
      1)创建assets文件 存放动态图片
      2)ImageOptions imageOptions = new ImageOptions.Builder()
                            .setIgnoreGif(false)
                            .setImageScaleType(ImageView.ScaleType.CENTER).build();
                    x.image().bind(image, "assets://d.gif", imageOptions);

    5.使用utils3加载网络数据
      RequestParams requestParams=new RequestParams("http://apicloud.mob.com/v1/cook/category/query?key=1d11949556a24");
                    x.http().get(requestParams, new Callback.CommonCallback<String>() {
                        @Override
                        public void onSuccess(String result) {
                            Log.d("sss","onSuccess::"+result);

                        }

                        @Override
                        public void onError(Throwable ex, boolean isOnCallback) {
                            Log.d("sss","onError::"+ex.getMessage());
                        }

                        @Override
                        public void onCancelled(CancelledException cex) {
                            Log.d("sss","onCancelled::"+cex.getMessage());
                        }

                        @Override
                        public void onFinished() {
                            Log.d("sss","onFinished::");

                        }
                    });
  • 相关阅读:
    ORA15196: invalid ASM block header
    Oracle Recovery Tools修复空闲坏块
    又一例asm disk 加入vg故障
    Oracle Recovery Tools快速解决sysaux文件不能online问题
    ORA00702一键恢复
    ORA604 ORA01558 恢复
    echo
    倒计时组件
    第五章第7节: 2020.06.15 智能互联网之弹性容器云与Service Mesh【七】 没用
    第五章第3节: 2020.05.30 智能互联网之弹性容器云与Service Mesh【三】
  • 原文地址:https://www.cnblogs.com/livelihood/p/6758757.html
Copyright © 2020-2023  润新知