I have Two activities here. Each of them will interact with a single Service i tried to Bind with.
But is it bad if I put in every onStart() method of each activities the binding code?
protected void onStart() {
super.onStart();
if(playIntent==null){
playIntent = new Intent(this, MusicService.class);
bindService(playIntent, musicConnection, Context.BIND_AUTO_CREATE);
startService(playIntent);
}
}
What about if from Activity - A i go to Activity - B, and then pressing the Back button? Would it be okay because Android will call onStart() method again, which means rebinding it again?
Rebinding twice from same Activity would it be bad practice or something?
The reference i got about the activity process is taken from here.