Fix for an android crash

This commit is contained in:
mhutti1 2016-09-26 10:47:35 +01:00
parent b4be999b44
commit f4c8d2beb8

View File

@ -107,6 +107,8 @@ public class DownloadFragment extends Fragment {
if (isAdded()) { if (isAdded()) {
int position = Arrays.asList(mKeys).indexOf(notificationID); int position = Arrays.asList(mKeys).indexOf(notificationID);
ViewGroup viewGroup = (ViewGroup) listView.getChildAt(position - listView.getFirstVisiblePosition()); ViewGroup viewGroup = (ViewGroup) listView.getChildAt(position - listView.getFirstVisiblePosition());
if (viewGroup == null)
return;
ProgressBar downloadProgress = (ProgressBar) viewGroup.findViewById(R.id.downloadProgress); ProgressBar downloadProgress = (ProgressBar) viewGroup.findViewById(R.id.downloadProgress);
downloadProgress.setProgress(progress); downloadProgress.setProgress(progress);
if (progress == 100) { if (progress == 100) {