上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 25 下一页
  2016年11月10日
摘要: 注意:请求网络需要添加网络权限 <uses-permission android:name="android.permission.INTERNET"/> 此demo中使用了接口回调、异步加载、HttpURLConnection请求 // 定义一个接口 public interface Weathe 阅读全文
posted @ 2016-11-10 16:57 巫山老妖 阅读(1272) 评论(0) 推荐(0) 编辑
  2016年11月8日
摘要: Android MVP Pattern Android MVP 模式1 也不是什么新鲜的东西了,我在自己的项目里也普遍地使用了这个设计模式。当项目越来越庞大、复杂,参与的研发人员越来越多的时候,MVP 模式的优势就充分显示出来了。 导读:MVP模式是MVC模式在Android上的一种变体,要介绍MV 阅读全文
posted @ 2016-11-08 20:58 巫山老妖 阅读(26410) 评论(1) 推荐(4) 编辑
  2016年11月4日
摘要: /** * 方法一:在构造函数中指定 */ /*Intent intent=new Intent(this,TwoActivity.class); startActivity(intent);*/ /** * 方法二:用 setClass 方法 */ /*Intent intent=new Inte 阅读全文
posted @ 2016-11-04 19:39 巫山老妖 阅读(1350) 评论(0) 推荐(0) 编辑
  2016年11月3日
摘要: // Activity1中的布局 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layou 阅读全文
posted @ 2016-11-03 18:46 巫山老妖 阅读(629) 评论(0) 推荐(0) 编辑
摘要: // 冒泡排序 int score []={12,42,34,3,2,8,59,50,48}; for (int i = 0; i < score.length-1; i++) { for (int j = 0; j < score.length-i-1; j++) { if (score[j] < 阅读全文
posted @ 2016-11-03 16:44 巫山老妖 阅读(153) 评论(0) 推荐(0) 编辑
  2016年10月26日
摘要: 注意:不是很完美 // 主布局文件 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layo 阅读全文
posted @ 2016-10-26 20:51 巫山老妖 阅读(1736) 评论(0) 推荐(0) 编辑
摘要: private void huodeshuju() { new AsyncTask<String, Void, String>() { @Override protected String doInBackground(String... params) { try { URL url=new UR 阅读全文
posted @ 2016-10-26 18:46 巫山老妖 阅读(207) 评论(0) 推荐(0) 编辑
  2016年10月19日
摘要: 实现步骤: 1、获取ConnectivityManager对象 2、获取NetworkInfo对象 3、判断当前网络状态是否为连接状态 4、在AndroidManifest.xml中添加访问当前网络状态权限 // 具体代码如下: package com.example.wangluo;import 阅读全文
posted @ 2016-10-19 18:32 巫山老妖 阅读(455) 评论(0) 推荐(0) 编辑
  2016年10月18日
摘要: // 主布局文件 <ListView android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/lv"></ListView> // 主Activity package com.ex 阅读全文
posted @ 2016-10-18 13:45 巫山老妖 阅读(3004) 评论(0) 推荐(0) 编辑
  2016年10月17日
摘要: 注意:此Demo用的是第三方的Xlistview.jar,需要复制me文件夹到项目中,两个XML布局文件和一张图片 把下面的复制到String中 <string name="xlistview_header_hint_normal">下拉刷新</string> <string name="xlist 阅读全文
posted @ 2016-10-17 15:38 巫山老妖 阅读(1182) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 25 下一页