zoukankan      html  css  js  c++  java
  • xtuils


    xutils的使用必须导入一个依赖

    protected
    void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); lv = (ListView) findViewById(R.id.lv); data(); } public void data(){ jiexi("http://huixinguiyu.cn/Assets/js/data.js "); } public void jiexi(String path){ RequestParams params=new RequestParams(path); x.http().get(params, new Callback.CacheCallback<String>() { @Override public void onSuccess(String result) { Gson gson=new Gson(); Bean bean = gson.fromJson(result, Bean.class); list = bean.getApk(); lv.setAdapter(new My()); lv.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { Intent intent=new Intent(MainActivity.this,Main2.class); intent.putExtra("url",list.get(i).getIconUrl()); startActivity(intent); } }); } @Override public void onError(Throwable ex, boolean isOnCallback) { } @Override public void onCancelled(CancelledException cex) { } @Override public void onFinished() { } @Override public boolean onCache(String result) { return false; } });
  • 相关阅读:
    logging 用于便捷记录日志且线程安全的模块
    win10安装多个mysql实例
    Windows安装mysql-msi
    webAPI解决跨域问题
    net core通过中间件防御Xss
    导出excel
    DES加密/解密类
    MySQL优化配置
    上传文件到服务器
    HttpWebRequest调用接口
  • 原文地址:https://www.cnblogs.com/leshen/p/7567023.html
Copyright © 2011-2022 走看看