I want to check if wifi is connected or not when the button is clicked as well as show a pop up message so i have written a separate class for it :
public class Pop extends Activity {
@Override
protected void onCreate(Bundle savedInstanceSate) {
super.onCreate(savedInstanceSate);
setContentView(R.layout.popup);
DisplayMetrics dm = new DisplayMetrics() ;
getWindowManager().getDefaultDisplay().getMetrics(dm);
int width = dm.widthPixels ;
int height = dm.heightPixels ;
getWindow().setLayout( (int)(width*.6),(int)(height*.4) ) ;
}
So what should be the method for checking if wifi is connected and it keeps on checking after every 5 seconds even if the app is closed ?