AlertDialog setButton Deprecated

Solution:

public void alertMy(String sTitle, String sMessage){
	AlertDialog.Builder builder = new AlertDialog.Builder(Test.this); // activity
  builder.setTitle(sTitle)
  .setMessage(sMessage)
  .setCancelable(false)
  .setNegativeButton("Close",new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog, int id) {
          dialog.cancel();
      }
  });
  AlertDialog alert = builder.create();
  alert.show();
 
}
This entry was posted in Bugs, warnings, errors and tagged , , . Bookmark the permalink.


Comments are closed.



6,314 views