rdmrbtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
AlertDialog alert = new AlertDialog.Builder(getApplicationContext()).create();
alert.setTitle("No Internet access");
alert.setMessage("You can't reach the discussion from the Offline mode");
alert.setButton("OK", new OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
})
}
});
I want show the mentioned alert when the readmore button("rdmrbtn") is clicked. But it gives me some compile errors. Please would you guyz help me out. Thank you.
Try
rdmrbtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
AlertDialog alert = new AlertDialog.Builder(YourActivity.this).create();
alert.setTitle("No Internet access");
alert.setMessage("You can't reach the discussion from the Offline mode");
alert.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
alert.show();
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With