1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 08:30:44 +00:00

fixed related videos nullpointer exception

This commit is contained in:
Christian Schabesberger 2016-09-26 18:01:39 +02:00
parent abfdcea4db
commit 931f34d2fd

View File

@ -145,12 +145,8 @@ public class VideoItemDetailFragment extends Fragment {
progressBar.setVisibility(View.GONE);
if(info.next_video != null) {
infoItemBuilder.setOnItemSelectedListener(new InfoItemBuilder.OnItemSelectedListener() {
@Override
public void selected(String url) {
openStreamUrl(url);
}
});
// todo: activate this function or remove it
nextStreamView.setVisibility(View.GONE);
} else {
nextStreamView.setVisibility(View.GONE);
activity.findViewById(R.id.detail_similar_title).setVisibility(View.GONE);
@ -522,6 +518,12 @@ public class VideoItemDetailFragment extends Fragment {
for (final StreamPreviewInfo item : info.related_streams) {
similarLayout.addView(infoItemBuilder.buildView(similarLayout, item));
}
infoItemBuilder.setOnItemSelectedListener(new InfoItemBuilder.OnItemSelectedListener() {
@Override
public void selected(String url) {
openStreamUrl(url);
}
});
}
private void onErrorBlockedByGema() {