2013年6月10日 星期一
android AlertDialog.Builder listview 未整理 (夜市人生phone的ListViewAdapter_Frag_ShopBills.java)
//get data
//不同張訂單
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
builder.setTitle("增加備註");
builder.setMultiChoiceItems(arr_ClassMemoName, arr_isClick, new OnMultiChoiceClickListener(){
@Override
public void onClick(DialogInterface dialog, int which,boolean isChecked) {
arr_isClick[which] = isChecked;
}
});
//按下確定
builder.setPositiveButton("確定",new DialogInterface.OnClickListener(){
public void onClick(DialogInterface arg0, int arg1) {
//增加備註
for(int i=0;i< arr_isClick.length;i++){
if(arr_isClick[i]==true){
list_SingleBills.get(position).list_ClassMemo.add(arr_ClassMemoID[i]);//把勾選備註加進來
int ClassMemoPrice = Integer.parseInt(list_ClassMemo.get(i).str_Price);//該個備註價錢
arr_i_productMemoPrice[position] += ClassMemoPrice;//加到總備註
}else{
//取消備註
// ArrayList temp_list_ClassMemo = list_SingleBills.get(position).list_ClassMemo;
for(int j = 0 ; j < list_SingleBills.get(position).list_ClassMemo.size() ; j++)
{
if(list_SingleBills.get(position).list_ClassMemo.get(j).equals(arr_ClassMemoID[i]))
{
list_SingleBills.get(position).list_ClassMemo.remove(j);
}
}
}
}
listViewAdapter_Frag_GoodsList.notifyDataSetChanged();//刷新自己
}
});
builder.setNegativeButton("取消",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
builder.show();
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言