Android中顯示AlertDialog對話框 代碼:
new AlertDialog.Builder(getApplicationContext())
.setTitle(R.string.search_result_is_null_alert_title)
.setPositiveButton(android.R.string.ok, new OnClickListener() {
@Override
public void onClick (DialogInterface dialog, int which) {
}
})
.setNegativeButton(android.R.string.cancel, new OnClickListener(){
@Override
public void onClick(DialogInterface arg0, int arg1) {
// TODO Auto-generated method stub
}
}).show();
更多Android相關信息見Android 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=11