I have a background task that occasionally prompts the user with dialogs and I would like it to run through the life of the application. Right now everything is controlled from a task fragment. So I was wondering if it is possible to create this fragment from a custom application class that extends Application
and if so how can you do it?
Asked
Active
Viewed 22 times
1
![](../../users/profiles/4433819.webp)
David Carek
- 995
- 1
- 9
- 25
-
"I would like it to run through the life of the application" -- what does this mean, in programming terms? "So I was wondering if it is possible to create this fragment from a class that extends Application" -- no, sorry. – CommonsWare Oct 25 '17 at 12:50
1 Answers
1
Fragment
class in android extends from android.app.Fragment
. Application
class extends from android.app.Application
.
If you want to launch your fragment from your application just do it using fragmentManager
in Android.
![](../../users/profiles/3343174.webp)
Fakher
- 2,001
- 3
- 26
- 45