需要用到的权限
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /><uses-permission android:name="android.permission.INTERNET"/>
//判断当前网络是否可用public boolean note_Intent(Context context) {      ConnectivityManager con = (ConnectivityManager) context          .getSystemService(Context.CONNECTIVITY_SERVICE);      NetworkInfo networkinfo = con.getActiveNetworkInfo();      if (networkinfo == null || !networkinfo.isAvailable()) {      // 当前网络不可用           Toast.makeText(context.getApplicationContext(), "当前网络不可用",          Toast.LENGTH_SHORT).show();          return false;      }      boolean wifi = con.getNetworkInfo(ConnectivityManager.TYPE_WIFI)          .isConnectedOrConnecting();      if (!wifi) { // 提示使用wifi           Toast.makeText(context.getApplicationContext(), "建议您使用WIFI以减少流量!",          Toast.LENGTH_SHORT).show();      }      return true;    }

跳转到系统设置WIFI界面中
Intent localIntent = new Intent();localIntent.setComponent(new ComponentName("com.android.settings","com.android.settings.wifi.WifiPickerActivity"));startActivityForResult(localIntent, 100);

更多相关文章

  1. Android Studio 实现播放本地/网络视频
  2. Android中检测网络连接状况的方法
  3. android中判断网络是否连接
  4. [置顶] Android 网络连接--Wifi/3G
  5. Android访问网络,使用HttpURLConnection还是HttpClient?
  6. Android : 网络版学生系统
  7. Android中使用Tcpdump抓取网络数据包
  8. Android 网络通信——HttpClient

随机推荐

  1. Android 百度鹰眼轨迹SDK(v2.1.6)
  2. 浅谈android中的mvc模式
  3. Android图片内存优化的几点心得
  4. 写给Android App开发人员看的Android底层
  5. Android中常用的位图操作
  6. Android(安卓)Studio 3.1.1 打Jar包出现A
  7. Android实现翻页特效
  8. Android面试之----Android系统架构图及简
  9. android系统文件的权限
  10. Android之RemoteViews篇上————通知栏