1

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?

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 Answers1

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.

Fakher
  • 2,001
  • 3
  • 26
  • 45