I need to start an android service from activity and stop the activity and stop service from other activity.
any help will be appreciated
I need to start an android service from activity and stop the activity and stop service from other activity.
any help will be appreciated
A service skeleton:
This is part of the starting activity:
This is part of the stopping activity:
How to start/stop android service?
startService(intent)
orstopService(intent)
These functions can be called from any activity.
How to stop an activity? - By this i understand that you need to navigate away from this activity. The function call
finish()
would remove the activity from the activity stack.