Friday, February 28, 2014

Ask: how to use code to restart the service?


Point of activity a button, perform the functions of a service restart, how to achieve?<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
service binder can get.

Reply:
First stop the service, and then start
Code:
 Intent intent = new Intent (this, yourservice.class); 
stopService (intent);
startService (intent);

Reply:
Thank you, I try to see

No comments:

Post a Comment