安卓编程 alertdialog setpositivebutton 监听问题
新手学习安卓编程现在卡在点击一个button出现一个提示框提示框上设定了positivebutton和negativebutton,接下来再点击positivebutto...
新手学习安卓编程 现在卡在 点击一个button 出现一个提示框 提示框上设定了positivebutton和negativebutton,接下来再点击positivebutton,进入另外一个activity,这个在setpositivebutton里面该怎么写
private void openNewGameDialog(){
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle(R.string.Alert_title)
.setMessage(R.string.Alert_text)
.setNegativeButton("No", null)
.setPositiveButton("Yes", new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog,int which){
}
}).show();
} 展开
private void openNewGameDialog(){
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle(R.string.Alert_title)
.setMessage(R.string.Alert_text)
.setNegativeButton("No", null)
.setPositiveButton("Yes", new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog,int which){
}
}).show();
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询