Skip to content
Snippets Groups Projects
Commit 39b7a972 authored by akwizgran's avatar akwizgran
Browse files

"Implicit intents with startService are not safe" - use an explicit one.

parent 3a01a04c
No related branches found
No related tags found
No related merge requests found
......@@ -69,8 +69,8 @@ public class BriarActivity extends RoboFragmentActivity {
}
private void startAndBindService() {
startService(new Intent(BriarService.class.getName()));
bound = bindService(new Intent(BriarService.class.getName()),
startService(new Intent(this, BriarService.class));
bound = bindService(new Intent(this, BriarService.class),
serviceConnection, 0);
}
......
......@@ -124,12 +124,10 @@ public class BriarService extends RoboService implements EventListener {
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if(LOG.isLoggable(INFO)) LOG.info("Started");
return START_NOT_STICKY; // Don't restart automatically if killed
}
public IBinder onBind(Intent intent) {
if(LOG.isLoggable(INFO)) LOG.info("Bound");
return binder;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment