大神们帮忙看看我这个list.remove怎么才能调用

         //长按事件
        list.setOnItemLongClickListener(new OnItemLongClickListener() {
                   @Override
                   public boolean onItemLongClick(AdapterView<?> parent, View view,
                   final int position, long id) {
                   //listerner方法
                  android.content.DialogInterface.OnClickListener listener=new
                  android.content.DialogInterface.OnClickListener() {
                               @Override
                               public void onClick(DialogInterface dialog, int which) {
                               // TODO Auto-generated method stub 
                              list.remove(position);
                              notifyAll();
                              }
                    };
                   //长按item时弹出对话框
    Builder builder=new Builder(MusicList.this);
    builder.setTitle("确定要删除吗?");
    builder.setPositiveButton("确定",listener);
    builder.setNegativeButton("取消",null);
    builder.show();
    return false;
   }
         
  });
        }

慕前端6305810
浏览 1295回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Android