samedi 3 juillet 2021

crash when Arraylist of string is null

videoLoadViewModel.getList_of_Images(getActivity()).observe(getViewLifecycleOwner(), new Observer<ArrayList>() { @Override public void onChanged(ArrayList strings) {

            if (strings==null) {
                recyclerView.setVisibility(View.INVISIBLE);
                textNoVideo.setVisibility(View.VISIBLE);
            } else {
                textNoVideo.setVisibility(View.INVISIBLE);
                recyclerView.setVisibility(View.VISIBLE);
                VideoShowAdaptor videoShowAdaptor = new VideoShowAdaptor(strings, getContext());
                recyclerView.setAdapter(videoShowAdaptor);
                videoShowAdaptor.notifyDataSetChanged();
            }
        }
    });

Aucun commentaire:

Enregistrer un commentaire