应用程序运行就退出
在应用程序的进入页面,做一个网络的判断和数据获取了更新的判断,结果程序刚打开,就挂了,logcat也没有错误信息,不知道是什么原因,各位大神帮忙看下。。
if (Utils.checkNetworkStatus(this)) {
CustomizeToast.toast(this, "请检查网络连接", Toast.LENGTH_LONG);
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finish();
} else {
new Thread(new Runnable() {
public void run() {
XMLData xmlDate = new XMLData();
listUpdate = xmlDate.CData(Settings.Update_url,
Function.Update);
handler = myhandler;
Message msg = new Message();
msg.what = 2;
handler.sendMessage(msg);
}
}).start();
}
case 2:
Map map = (Map) listUpdate.get(0);
int urlcode = Integer.parseInt((String) map.get("verCode"));
if (urlcode > getVersion()) {
Log.w("sh", "需要更新");
Intent intentu = new Intent();
intentu.setClass(WelcomeActivity.this, Update.class);
Bundle bundle = new Bundle();
bundle.putParcelableArrayList("listUpdate",
(ArrayList) listUpdate);
intentu.putExtras(bundle);
startActivity(intentu);
finish();
} else {
Intent intent = new Intent();
intent.setClass(WelcomeActivity.this, MainActivity.class);
startActivity(intent);
finish();
Log.w("sh", "不需要更新");
}
break;