This is my Code, Alert box appears here like Yes /No. But what i need is, 
When i click Yes button , it automatically should enable WiFi by 
progeammatically and if i click No then aopplication must be closed. What 
should i do here . Please can anyone help me?


       public void onClick(DialogInterface dialog, int which) {
 Toast.makeText(getApplicationContext(), "'Yes',WiFi Enabled 
Now",Toast.LENGTH_SHORT).show();
// TODO Auto-generated method stub
 }
});
 alertbox.setNegativeButton("No", new DialogInterface.OnClickListener() {
 @Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(getApplicationContext(), "'No',WiFi Disabled so application 
is closed", Toast.LENGTH_SHORT).show(); 
 // TODO Auto-generated method stub
 }
});
alertbox.show();

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to