I am newbie in android. May I Know how to add a alertDialog as confirmation in wifi setting. The alertDialog should consist "yes" for turn on wifi while "no" for close the app. here is part of coding:
> // Check for wifi is disabled > if (mainWifi.isWifiEnabled() == false) > { > // If wifi disabled then enable it > Toast.makeText(getApplicationContext(), "wifi is disabled..making it enabled", > Toast.LENGTH_LONG).show(); > > AlertDialog.Builder alertDialog = new AlertDialog.Builder(this); > > // Setting Dialog Title > alertDialog.setTitle("Confirm..."); > > // Setting Dialog Message > alertDialog.setMessage("Do you want to turn on your wifi?"); > > > /* i want to add in "YES" and "NO" for the wifi setting > * > * if yes then turn on > * { > * * mainWifi.setWifiEnabled(true); > * } > * if no then close the app > * { > * // if this button is clicked, close > > mainWifi.this.finish(); > * } > * > * > * > * */ > // Showing Alert Message > alertDialog.show(); > }