How can I stop my Service in another Activity?
I start the service in my summaryActivity
SocketServiceIntent = new Intent(this, SocketService.class);
SocketServiceIntent.putExtra("MessageParcelable", mp);
startService(SocketServiceIntent);
And start my statusActivity from my summaryActivity
Intent intent = new Intent(SummaryActivity.this,
StatusActivity.class);
intent.putExtra("MessageParcelable", mp);
startActivity(intent);
My problem is that I don't know how I can give my Statusactivity the SocketServiceIntent.
You should call Activity(ContextWrapper)#stopService
:
stopService(new Intent(SummaryActivity.this, SocketService.class));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With