linuxman94

yep

Jan 27th, 2014
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. public boolean currentWifiState(Context context) {
  2. ConnectivityManager cm = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
  3. NetworkInfo mWifi = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
  4. if(mWifi.isConnected()) {
  5. return true;
  6. }
  7. return false;
  8. }
Advertisement
Add Comment
Please, Sign In to add comment