Normal way of using a bound service:
private ServiceConnection musicConnection = new ServiceConnection() {
public void onServiceConnected(ComponentName name, IBinder service) {
MusicBinder binder = (MusicBinder)service;
//get service
musicSrv = binder.getService();
//pass list
musicBound = true;
}
@Override
public void onServiceDisconnected(ComponentName name) {
musicBound = false;
}
};
Intent playIntent = new Intent(this, MusicService.class);
bindService(playIntent, musicConnection, Context.BIND_AUTO_CREATE);
Instead of this, can't we use this:
MusicService music=new MusicService();
If yes, will there be any differences between the two instances obtained in two different ways?