|
@@ -37,7 +37,7 @@ public class NetUtil {
|
|
|
public static boolean isConnected(Context context)
|
|
public static boolean isConnected(Context context)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
- ConnectivityManager connectivity = (ConnectivityManager) context
|
|
|
|
|
|
|
+ ConnectivityManager connectivity = (ConnectivityManager) SheepApp.getInstance()
|
|
|
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
|
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
|
|
|
|
|
|
|
if (null != connectivity)
|
|
if (null != connectivity)
|
|
@@ -60,7 +60,7 @@ public class NetUtil {
|
|
|
*/
|
|
*/
|
|
|
public static boolean isWifi(Context context)
|
|
public static boolean isWifi(Context context)
|
|
|
{
|
|
{
|
|
|
- ConnectivityManager cm = (ConnectivityManager) context
|
|
|
|
|
|
|
+ ConnectivityManager cm = (ConnectivityManager) SheepApp.getInstance()
|
|
|
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
|
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
|
|
|
|
|
|
|
if (cm == null)
|
|
if (cm == null)
|
|
@@ -74,7 +74,7 @@ public class NetUtil {
|
|
|
*/
|
|
*/
|
|
|
public static boolean isMobile(Context context)
|
|
public static boolean isMobile(Context context)
|
|
|
{
|
|
{
|
|
|
- ConnectivityManager cm = (ConnectivityManager) context
|
|
|
|
|
|
|
+ ConnectivityManager cm = (ConnectivityManager) SheepApp.getInstance()
|
|
|
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
|
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
|
|
|
|
|
|
|
if (cm == null)
|
|
if (cm == null)
|