Skip to content

Instantly share code, notes, and snippets.

@JoanZapata
Created April 24, 2014 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoanZapata/11259974 to your computer and use it in GitHub Desktop.
Save JoanZapata/11259974 to your computer and use it in GitHub Desktop.
import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
public abstract class LocalService<T> extends Service {
@Override
public IBinder onBind(Intent intent) {
return new LocalServiceBinder();
}
public class LocalServiceBinder extends Binder {
public T getService() {
return (T) LocalService.this;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment