i am using a service call in activity button on click method
the activity and service is running correctly
when the start button is clicked the message displayed that activity is started,
and now user can switch to other activity.
but when user again open the same actvity ,then how to show the service status ,that the service is running correctly in background.
I think the simpler way is to have a static boolean variable in your Service that indicates its current state. You could set it to true when the service starts running and set to false when it’s stopped and retrieve it from your activity to show the user the proper message.
However, if you don’t like this approach you can also tell us how are you starting the service and when it should be stopped/started to see other solutions.