---
title: "wifi判断"
author: "lversam"
date: "2012-04-25T16:04:14Z"
tags: []
categories: ["移动开发"]
slug: "wifi"
draft: false
lastmod: "2012-04-25T16:04:14Z"
id: 1498137
url: "https://lversam.iteye.com/blog/1498137"
---

```java


	WifiManager wifi = (WifiManager) getSystemService(WIFI_SERVICE);
		if (wifi.isWifiEnabled()) {
			
		} else {
			Toast.makeText(MainActivity.this, "您的WIFI未开启，请在开启WIFI后再进入！", 3000).show();
			this.finish();
		}

```