Minor refactoring

This commit is contained in:
nielsandriesse 2020-08-24 14:47:28 +10:00
parent 4cc22608aa
commit 4d7b179008

View File

@ -57,15 +57,15 @@ class ContactSelectionListFragment : Fragment(), LoaderManager.LoaderCallbacks<L
LoaderManager.getInstance(this).initLoader(0, null, this) LoaderManager.getInstance(this).initLoader(0, null, this)
} }
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.contact_selection_list_fragment, container, false)
}
override fun onStop() { override fun onStop() {
super.onStop() super.onStop()
LoaderManager.getInstance(this).destroyLoader(0) LoaderManager.getInstance(this).destroyLoader(0)
} }
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.contact_selection_list_fragment, container, false)
}
fun setQueryFilter(filter: String?) { fun setQueryFilter(filter: String?) {
cursorFilter = filter cursorFilter = filter
LoaderManager.getInstance(this).restartLoader(0, null, this) LoaderManager.getInstance(this).restartLoader(0, null, this)
@ -101,7 +101,7 @@ class ContactSelectionListFragment : Fragment(), LoaderManager.LoaderCallbacks<L
private fun update(items: List<ContactSelectionListItem>) { private fun update(items: List<ContactSelectionListItem>) {
if (activity?.isDestroyed == true) { if (activity?.isDestroyed == true) {
Log.e(ContactSelectionListFragment::class.java.name, Log.e(ContactSelectionListFragment::class.java.name,
"Received a loader callback after the fragment was detached from an activity.", "Received a loader callback after the fragment was detached from the activity.",
IllegalStateException()) IllegalStateException())
return return
} }