try {
            Thread.sleep(10);
            
            Toast.makeText(getApplicationContext(),
                    "睡醒了",
                    Toast.LENGTH_LONG).show();
        } catch (InterruptedException e1) {
        
            e1.printStackTrace();
        }
        new Thread(new Runnable() {
            
            @Override
            public void run() {
                
                try {

                    
                    Toast.makeText(getApplicationContext(),
                            "睡醒了",
                            Toast.LENGTH_LONG).show();

                    if(isWifiConnected(getApplicationContext())){
                        final WifiInfo info = mWifiManager.getConnectionInfo();
                        if(info.getSSID().toString().equals(tmpssid)||tmpssid==info.getSSID().toString()){
                            Toast.makeText(getApplicationContext(),
                                    "连接网络成功",
                                    Toast.LENGTH_LONG).show();
                        }else{
                            Toast.makeText(getApplicationContext(),
                                    "连接网络失败",
                                    Toast.LENGTH_LONG).show();
                        }
                    }else{
                        Toast.makeText(getApplicationContext(),
                                "连接网络失败",
                                Toast.LENGTH_LONG).show();
                    }
                    
                } catch (Exception e) {
                    
                    e.printStackTrace();
                }
            }
        }).start();
       

更多相关文章

  1. Android Http网络开发神兵利器
  2. android 网络图片与网页读取
  3. 判断Android客户端网络是否连接
  4. Android中网络判断
  5. 直播源码用Glide框架缓存压缩图片做一个网络图片查看器
  6. android 开源自组织网络开源包
  7. android 检查可用网络
  8. Android: 判断网络状态
  9. 【原创】android webview 加载网络视频

随机推荐

  1. Android(安卓)7.0 以上 安装 apk 的方法
  2. 有关Android发送E-mail
  3. Android(安卓)NDK 开发问题及解决方法
  4. android 杂记2:单位 屏幕适配
  5. Android(安卓)Keymaster/keystore的代码
  6. Android(安卓)动态改变TextView字体大小
  7. Android之TabHost的几种使用方法
  8. Android(安卓)控件的显示隐藏上下左右移
  9. Android(安卓)6.0运行时权限小结
  10. Android“时区”的那些事儿(1)