摘要:
很多android程序在打开时,检测网络是否连接,或者GPS是否可用:1.网络是否连接(包括Wifi和移动网络)//是否有可用网络privatebooleanisNetworkConnected(){ConnectivityManagercm=(ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE);NetworkInfonetwork=cm.getActiveNetworkInfo();if(network!=null){returnnetwork.isAvailable();}returnfal 阅读全文
posted @ 2013-11-19 11:05
lh92lxm
阅读(285)
评论(0)
推荐(0)