Dialog选项保存
如图,通过点击按钮弹出多选对话框,程序关掉后所选的信息会丢失,不知道该怎么办,下面的代码是多选对话框代码finalbooleandateData[]=newboolean...
如图,通过点击按钮弹出多选对话框,程序关掉后所选的信息会丢失,不知道该怎么办,下面的代码是多选对话框代码
final boolean dateData[]=new boolean[]{false,false,false,false,false,false,false};
this.yizhou=(Button)super.findViewById(R.id.yizhou);
yizhou.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Dialog dialog=new AlertDialog.Builder(myBaoshidemo.this)
.setTitle("设置一周报时时段")
.setPositiveButton("确定",new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog,int which){
}
}).setNegativeButton("取消",new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog,int which){
}
}).setMultiChoiceItems(R.array.date_labels,dateData,
new DialogInterface.OnMultiChoiceClickListener(){
@Override
public void onClick(DialogInterface dialog, int which,
boolean isChecked) {
}
}).create();
dialog.show();
}
}); 展开
final boolean dateData[]=new boolean[]{false,false,false,false,false,false,false};
this.yizhou=(Button)super.findViewById(R.id.yizhou);
yizhou.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Dialog dialog=new AlertDialog.Builder(myBaoshidemo.this)
.setTitle("设置一周报时时段")
.setPositiveButton("确定",new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog,int which){
}
}).setNegativeButton("取消",new DialogInterface.OnClickListener(){
@Override
public void onClick(DialogInterface dialog,int which){
}
}).setMultiChoiceItems(R.array.date_labels,dateData,
new DialogInterface.OnMultiChoiceClickListener(){
@Override
public void onClick(DialogInterface dialog, int which,
boolean isChecked) {
}
}).create();
dialog.show();
}
}); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询