I have found an application with many activities, for example:
Activity 1 - & gt; ; Activity 2 - & gt; Activity 3 - & gt; Activity 4
And I would like to stop all activities from any activity and return back home.
You can get it by using BroadcastReceivers :
BaseActivity in this way:
extends the public square base activity activity {Private Killrescrew mKillReceiver; @ Override protected void saved create (bundled Instansstet) {Suprknkret (saved Instensstet); MKillReceiver = New KillReceiver (); Register Receiver (M. Kail receiver, Intent filter.cent ("kill", "Spartan !!!")); } @ Overhaired Protected Zero Destroy () {Super. Onesteroy (); UnregisterReceiver (mKillReceiver); } Private Final Class KillReceiver Broadcast Receiver Expands {@ Override Public Records on Receive (Context Reference, Intention Intention) {Finnish ();
intent = new intent ("kill"); Intent.setType ("Spartan !!!"); SendBroadcast;
Comments
Post a Comment