Android 判断是否有网络
摘要:
首先需要添加权限: <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.INTERNET" />判断是否有网络的代码:public boolean isNetworkAvailable() { Context context = getApplicationContext(); ConnectivityManager connect = 阅读全文
posted @ 2013-02-28 09:14 program_lover 阅读(202) 评论(0) 推荐(0) 编辑