-1
我已經使用AlertDialog,當點擊按鈕它將轉到主屏幕。我沒有得到警戒框?意外的行爲onclick
alertDialog.setPositiveButton(R.id.button1, new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
Toast.makeText(getActivity(), "save me**********************", Toast.LENGTH_SHORT).show();
Toast.makeText(getActivity(), "you have pressed save", Toast.LENGTH_SHORT).show();
}
});
alertDialog.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
請發佈完整的代碼,並解釋正確。 – 2014-09-02 06:38:55
您是否爲'AlertDialog'調用'show()'方法? – Piyush 2014-09-02 06:45:02
我認爲可能我alertDialog.show()不叫你 – 2014-09-02 06:47:35