May 29, 2014

Android message box

Builder dlgAlert = new Builder(MainActivity.this); View1.setText(_data); dlgAlert.setMessage(_data); dlgAlert.setTitle("Thong bao"); dlgAlert.setCancelable(true); dlgAlert.setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub View1.setText("OK"); } }).setNeutralButton("NO", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub View1.setText("NO"); } }).setNegativeButton("CANCEL", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub View1.setText("CANCEL"); } }); dlgAlert.show();

0 comments:

Post a Comment

Nam Le © 2014 - Designed by Templateism.com, Distributed By Templatelib