adsense

2011-03-28

[android] AlertDialog 按鈕介紹



AltertDialog  有PositiveButton    NeutralButton   NegativeButton可使用

private void openOptionsDialog() {
// TODO Auto-generated method stub
new AlertDialog.Builder(Bmi.this)
.setTitle(R.string.about_title)
.setMessage(R.string.about_msg)
.setPositiveButton("確定", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int i) {
// TODO Auto-generated method stub

}
})
.setNeutralButton("取消", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int j) {
// TODO Auto-generated method stub

}
})
.setNegativeButton("取消1", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int j) {
// TODO Auto-generated method stub

}
})
.show();

}

沒有留言:

張貼留言