0
ListView에서 선택한 항목을 제거해야하므로이 코드를 작성했습니다. 난이 참조 로그 캣에서 선택한 항목 제거 Listview
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if(requestCode == 1) {
try {
for(int a=0; a<myAdapter.getCustomItemPositions().size(); a++) {
applicationInfo = getPackageManager().getApplicationInfo(myAdapter.getArrayListPosition().get(a), a);
}
} catch(PackageManager.NameNotFoundException e) {
applicationInfoArrayList.remove(myAdapter.getCustomItemPositions());
Log.d("Example", "removed items at positions "+myAdapter.getCustomItemPositions());
myAdapter.notifyDataSetChanged();
}
}
else {
}
}
:
"위치에서 제거 항목 위치에서 [10,11] 제거 항목 [10,11]가"
주요 문제를 비록 로그는 제거 할 요소의 올바른 위치이지만 목록에 남아 있습니다. 왜? 내 영어로 미안해.
adapter.remove(adapter.getItem(position));
내가 시도했지만 작동하지 않습니다 – user3187166