判断当前网络是否可用和调用系统设置wifi界面
来源:互联网 发布:mac打碟软件vitualdj 编辑:程序博客网 时间:2024/06/15 23:34
需要用到的权限
<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);
0 0
- 判断当前网络是否可用和调用系统设置wifi界面
- Android判断网络是否可用,调用系统网络设置
- android 判断网络是否可用,并调用系统设置项
- android 判断当前网络是否可用(ping网络),包含wifi和移动数据网络
- Android 判断当前网络连接是否可用、打开设置网络界面
- app判断当前网络是否可用并开启wifi和开启GPRS
- 判断当前网络是否可用
- 判断当前网络是否可用
- 判断当前网络是否可用
- 判断当前网络是否可用
- 判断当前网络是否可用
- 判断当前网络是否可用
- Android 判断开启网络,wifi是否可用
- Android判断是否有可用网络和判断WIFI是否ON
- Android判断当前网络是否可用
- Android判断当前网络是否可用
- Android中判断当前网络是否可用
- c# 判断当前网络是否可用
- 因为MVC5 新建项目里不包含jquery.unobtrusive-ajax.js
- 常见的正则表达式
- Emgucv实现Unsharp Mask USM锐化算法
- 零基础入门深度学习系列
- 了解ASP.NET MVC几种ActionResult的本质:JavaScriptResult & JsonResult
- 判断当前网络是否可用和调用系统设置wifi界面
- Java同步机制 synchronized
- permute -排列
- 优秀githup
- ADO接口中_RecordsetPtr的使用说明
- tomcat在eclipse中调试时,断点频繁停在threadpoolexecutor
- SpringAOP拦截Controller,Service实现日志管理(自定义注解的方式)
- 理解MySQL——索引与优化
- eclipse自动退出解决方法