You could try and extend DialogFragment instead; inside DialogFragment
custom class you should have visibility to getLoaderManager()
method.
Loader manager inside Dialog
-
28-06-2022 - |
Question
I'm trying to create custom Dialog
with ListView
inside it. For loading data from DB I tried to use LoaderManager
, but there is no method getLoaderManager()
in Dialog
class.Does anybody know how can I get it? Or how can I use LoaderManager
inside Dialog
.
Solution
OTHER TIPS
A dialog is usually created and managed by an Activity, which is its owner. You could get this Activity by calling Dialog.getOwnerActivity()
[1] and use its LoaderManager.
Be careful though, the documentation states that this method may in some cases return null
.
[1] http://developer.android.com/reference/android/app/Dialog.html#getOwnerActivity()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow