Thanks Mark. I went about this another way, as I forgot to mention
that I was going from an activity, to a broadcastreceiver, to a class.
I ended up calling the same activity with the FLAG_ACTIVITY_SINGLE_TOP
and FLAG_ACTIVITY_NEW_TASK flags, and then calling the finish() in the
onNewIntent event of the intent.

On Nov 12, 12:51 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
> g1bb wrote:
> > Hi Mark,
>
> > Sorry, I forgot to mention that I would like to destroy the activity
> > from a different class not associated with the activity. Is that
> > possible?
>
> Provide that class with a reference to your Activity when you create it.
>
> E.g.:
>
> class ActivityKiller {
>         ActivityKiller(Activity victim) {
>                 this.victim=victim;
>         }
>
>         void pussycatKillKill() {
>                 victim.finish();
>         }
>
> }
>
> You will also need to arrange for background threads to close up shop,
> including the thread your alternate class' code is running on, if that's
> not the main UI thread.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
>
> Android Training on the Ranch! -- Mar 16-20, 
> 2009http://www.bignerdranch.com/schedule.shtml
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to