diff options
author | Will Szumski <will@cowboycoders.org> | 2016-11-22 18:08:37 +0000 |
---|---|---|
committer | Will Szumski <will@cowboycoders.org> | 2016-11-22 19:21:00 +0000 |
commit | e7181a750733cca12c674762a092da82e0958514 (patch) | |
tree | 7145556a942bafb78798a9efdd82d5f25fd81a2a /src/main/java | |
parent | 899ec173be1151ac603744d5b39cd2746f66be38 (diff) | |
download | andiodine-e7181a750733cca12c674762a092da82e0958514.tar.gz andiodine-e7181a750733cca12c674762a092da82e0958514.zip |
make findViewById more robust
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/xapek/andiodine/FragmentList.java | 3 |
1 files changed, 2 insertions, 1 deletions
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); |