BitfiWallet.NoxWifi.OnResume C# (CSharp) Method

OnResume() protected method

protected OnResume ( ) : void
return void
        protected override void OnResume()
        {
            try
            {
                string status = "WIFI NETWORKS: ";
                string SSID = "";
                using (Android.Net.Wifi.WifiManager wifi = (Android.Net.Wifi.WifiManager)ApplicationContext.GetSystemService(Context.WifiService))
                {
                    if (wifi != null)
                    {
                        if (wifi.IsWifiEnabled)
                        {
                            using (WifiInfo wifiInfo = wifi.ConnectionInfo)
                            {
                                if (wifiInfo != null)
                                {
                                    using (NetworkInfo.DetailedState state = WifiInfo.GetDetailedStateOf(wifiInfo.SupplicantState))
                                    {
                                        if (state == NetworkInfo.DetailedState.Connected || state == NetworkInfo.DetailedState.ObtainingIpaddr)
                                        {
                                            SSID = wifiInfo.SSID;
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            wifi.SetWifiEnabled(true);
                        }

                using (ConnectivityManager cm = (ConnectivityManager)GetSystemService(Context.ConnectivityService))
                {
                    if (cm != null)
                    {
                        using (NetworkInfo activeNetwork = cm.ActiveNetworkInfo)
                        {
                            if (activeNetwork != null && activeNetwork.IsConnected)
                            {
                                SSID = SSID.Replace("\"", "");
                                status = ": CONNECTED TO INTERNET. Select a network from the list below to modify or establish a connection.";
                                status = SSID + status;
                            }
                            else
                            {
                                if (activeNetwork == null)
                                {
                                    status = "WIFI NETWORKS: ";
                                }
                                else
                                {
                                    if (!string.IsNullOrEmpty(SSID))
                                    {
                                        status = " OBTAINING IP ADDRESS...";
                                        status = SSID + status;
                                    }
                                    else
                                    {
                                        status = "WIFI NETWORKS: ATTEMPTING CONNECTION...";
                                    }
                                }
                            }
                        }
                    }
                }
                IList\\ wifiScanList = wifi.ScanResults;
                    if (wifiScanList != null)
                    {
                        wifis = new string[wifiScanList.Count];
                        for (int i = 0; i \                        {
                            wifis[i] = ((wifiScanList[i]).ToString());
                        }
                        filtered = new List\\();
                        filtered.Add(status);
                        int counter = 0;
                        foreach (string eachWifi in wifis)
                        {
                            var rx = new string[] { "," };
                            string[] temp = eachWifi.Split(rx, StringSplitOptions.None);
                            string lval = temp[0].Substring(5).Trim();
                            if (!string.IsNullOrEmpty(lval) && lval.Length \>\ 3)
                            {
                                filtered.Add(lval);
                                counter++;
                            }
                        }
                    }
                    }
                }
                ListAdapter = new MyListAdapter(this);
            }
            catch (Exception)
            {
            }

            base.OnResume();
        }
        class MyListAdapter : BaseAdapter