in my application, I am going back and forth between two activities A and B.
in activity A user chooses listView content and,
in activity B user starts to listen shoutcast.
I am using an outside AACPlayer library with 2.2 SDK.
While going back to activity A, I didnot want to player paused or stopped, which I can manage to do.
However each time I go back to activity A from B, a new instance is started and if I press a new shoutcast they start to play at the same with the previous.
My question is, what should I do to come back to the current instance of the activity B.
My going back implementation is
public void onClick(View v) {
switch (v.getId()){
case R.id.buttonBack:
Intent info = new Intent(getBaseContext(),index.class);
info.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
HomeActivity.this.startActivity(info);
break;
}
Thank you very much.
I solved the problem by using Static fields in activity A. I made the methods of AAC Player static.
By this way I can start, stop or pause the radio player form activity B.
This is also much more correct in the sense of implementation. Because there suppose to be only one radio player.