0

In my app I am required to Stop the activity(MyAct.java) when a service(BackgroundService.java) is called, and further i wish to continue this service(BackgroundService.java).please help?

Sandroid
  • 328
  • 1
  • 10
  • 19

1 Answers1

0

Implement a started service, call startService(Intent service) in your activity(for instance, a button pressed) then call finish() immediately in your activity.

Check out here to see how to create a long running background service, even without need a activity to start the service.

Community
  • 1
  • 1
yorkw
  • 40,926
  • 10
  • 117
  • 130