用接口回调的方法实现异步请求网络数据
    
            
摘要:注意:请求网络需要添加网络权限 <uses-permission android:name="android.permission.INTERNET"/> 此demo中使用了接口回调、异步加载、HttpURLConnection请求 // 定义一个接口 public interface Weathe
        
阅读全文
                posted @ 
2016-11-10 16:57 
巫山老妖
        
阅读(1317) 
         
        推荐(0)     
             
            
            
    MVP模式
    
            
摘要:Android MVP Pattern Android MVP 模式1 也不是什么新鲜的东西了,我在自己的项目里也普遍地使用了这个设计模式。当项目越来越庞大、复杂,参与的研发人员越来越多的时候,MVP 模式的优势就充分显示出来了。 导读:MVP模式是MVC模式在Android上的一种变体,要介绍MV
        
阅读全文
                posted @ 
2016-11-08 20:58 
巫山老妖
        
阅读(26480) 
         
        推荐(4)     
             
            
            
    Activity之间的隐士跳转
    
            
摘要:/** * 方法一:在构造函数中指定 */ /*Intent intent=new Intent(this,TwoActivity.class); startActivity(intent);*/ /** * 方法二:用 setClass 方法 */ /*Intent intent=new Inte
        
阅读全文
                posted @ 
2016-11-04 19:39 
巫山老妖
        
阅读(1364) 
         
        推荐(0)     
             
            
            
    Activity与Activity之间的传值
    
            
摘要:// 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 
巫山老妖
        
阅读(636) 
         
        推荐(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 
巫山老妖
        
阅读(168) 
         
        推荐(0)