I would need to check the wifi is on or off in the phone at the runtime?
if it is not connected, i want to show dialog and goto directly Setting/Wireless Controls to
private boolean isNetworkAvailable() {
ConnectivityManager connManager = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connManager.getActiveNetworkInfo();
return activeNetworkInfo.isConnected();
}
public void onClick(DialogInterface dialog, int id) {
// ...
if (isNetworkAvailable()) {
t3.setText("The Internet is available");
} else {
t3.setText("internet is not available");
}
}