//这段代码   我服务器上的版本号 与本地的版本号是不同的   获取服务器版本号 也打印出来了 。。所以会执行else 里面的代码   可是却没有执行。else 里面的打印的语句都没有出来
 StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
        .detectDiskReads()
        .detectDiskWrites()
        .detectNetwork()   // or .detectAll() for all detectable problems
        .penaltyLog()
        .build());
        StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
        .detectLeakedSqlLiteObjects()
        .detectLeakedClosableObjects()
        .penaltyLog()
        .penaltyDeath()
        .build());
    //访问互联网代码结束     --------  
String path = "http://www.kskjkf.com/version/version.xml";//服务器地址 version.xml:文件里面写的是版本号其实就是个判断的标志
try {
URL url = new URL(path);//接收网址  path
HttpURLConnection conn = (HttpURLConnection) url  
.openConnection();  //链接到网址
conn.setConnectTimeout(5000);  //设置连接超时时间
Thread.sleep(4000);  // InputStream ins = conn.getInputStream();  //ins:得到的xml文件中内容  
//开始得到版本号-----
System.out.println("进入判断区了======》");
List<Version> personList;
try {
personList = ResolveVersionSax.readXML(path);//将服务器地址传过来开始解析
for(Version version : personList)
{
serviceVersion = version.getVersion();//得到int 类型的版本号
System.out.println("得到的标号 ---O(∩_∩)O哈!----"+serviceVersion);
}
} catch (Exception e) {
e.printStackTrace();

//得到版本号结束 ------   
int verson = DatabaseHelper.version;
if (verson==serviceVersion) {
finish();  
} else {  

System.out.println("如果不同就进入  ---------UpdateActivity");
final Intent it = new Intent(this,UpdateActivity.class);
Timer timer = new Timer();
TimerTask task= new TimerTask(){
@Override
public void run() {
startActivity(it);
}
};
timer.schedule(task, 1000*3);
}  
} catch (Exception e) {
e.printStackTrace();
}