Fixed crash when searching

Search view was set up (and started searching) before other views were
assigned.
This commit is contained in:
ByteHamster 2020-11-04 00:20:56 +01:00
parent 9f4c90ebfb
commit ad56eed255
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,6 @@ public class OnlineSearchFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// Inflate the layout for this fragment // Inflate the layout for this fragment
View root = inflater.inflate(R.layout.fragment_itunes_search, container, false); View root = inflater.inflate(R.layout.fragment_itunes_search, container, false);
setupToolbar(root.findViewById(R.id.toolbar));
root.findViewById(R.id.spinner_country).setVisibility(INVISIBLE); root.findViewById(R.id.spinner_country).setVisibility(INVISIBLE);
gridView = root.findViewById(R.id.gridView); gridView = root.findViewById(R.id.gridView);
adapter = new ItunesAdapter(getActivity(), new ArrayList<>()); adapter = new ItunesAdapter(getActivity(), new ArrayList<>());
@ -110,6 +109,7 @@ public class OnlineSearchFragment extends Fragment {
txtvEmpty = root.findViewById(android.R.id.empty); txtvEmpty = root.findViewById(android.R.id.empty);
TextView txtvPoweredBy = root.findViewById(R.id.search_powered_by); TextView txtvPoweredBy = root.findViewById(R.id.search_powered_by);
txtvPoweredBy.setText(getString(R.string.search_powered_by, searchProvider.getName())); txtvPoweredBy.setText(getString(R.string.search_powered_by, searchProvider.getName()));
setupToolbar(root.findViewById(R.id.toolbar));
return root; return root;
} }