修复刷新时点击正在刷新会闪退问题

This commit is contained in:
pppscn 2021-03-19 14:32:26 +08:00
parent 69ea5905d6
commit abe731efba
2 changed files with 4 additions and 0 deletions

View File

@ -99,6 +99,8 @@ public class MainActivity extends AppCompatActivity implements ReFlashListView.I
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (position <= 0) return;
LogVo logVo = logVos.get(position - 1);
logDetail(logVo);
}
@ -107,6 +109,8 @@ public class MainActivity extends AppCompatActivity implements ReFlashListView.I
listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, final int position, long id) {
if (position <= 0) return false;
//定义AlertDialog.Builder对象当长按列表项的时候弹出确认删除对话框
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setMessage("确定删除?");