[Android] How to restart service?

This is two lines of codes, I use to restart my Service class. First line will stop my service. Second line will start the service again.

stopService(new Intent(this, YourService.class));
startService(new Intent(this, YourService.class));

Comments

Popular posts from this blog

Fatal: LoadModule: error loading module 'mod_sql_mysql.c'

Regular Expression Route Constraints And Route Names in Laravel 5.4