From e7181a750733cca12c674762a092da82e0958514 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Tue, 22 Nov 2016 18:08:37 +0000 Subject: make findViewById more robust --- src/main/java/org/xapek/andiodine/FragmentList.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/xapek/andiodine/FragmentList.java b/src/main/java/org/xapek/andiodine/FragmentList.java index 10a0875..9d2bad3 100644 --- a/src/main/java/org/xapek/andiodine/FragmentList.java +++ b/src/main/java/org/xapek/andiodine/FragmentList.java @@ -123,7 +123,7 @@ public class FragmentList extends Fragment { public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mConfigDatabase = new ConfigDatabase(getActivity()); - mListView = (ListView) getActivity().findViewById(R.id.list_view); + mListView = (ListView) getView().findViewById(R.id.list_view); mAdapter = new IodineConfigurationAdapter(); mListView.setAdapter(mAdapter); @@ -134,6 +134,7 @@ public class FragmentList extends Fragment { setHasOptionsMenu(true); //activate onCreateOptionsMenu } + @Override public void onDestroy() { getActivity().unregisterReceiver(broadcastReceiverConfigurationChanged); -- cgit v1.2.1