I've implemented a "Sign Out" function before which was much like exit
except we still wanted the initial login screen to display.  You can
try to open your activities with startActivityForResult and in
onActivityResult check if you were sent an exit code you chose, then
call finish.... in every activity.  Lots of things can cause this to
fail though.

I find I typically have a ThisApplicationsActivities parent Activity
that most of my activities will inherit from.  So to implement
"SignOut" you change a static variable to indicate you've signed out,
and in onResume of this master Activity class check if the user is
currently logged in, and if not call finish().  This worked fine for
me.

On Dec 14, 8:12 pm, Jack Ganesh <ganesh...@gmail.com> wrote:
> Hi..,
>  i used the following :
>
> void onClick(){
> android.os.Process.killProcess(android.os.Process.myPid())
>
> System.exit(0);
>
> }
>
> but still its coming back to the previous activity.
>
> Any other try ? ?
>
> Cheers,
> Ganesh
>
>
>
> Hi Ganesh,there are two ways
>
> android.os.Process.killProcess(android.os.Process.myPid())
>
> System.exit(0);
>
> I normally use the second, I agree that some times you just want to
> properly exit an app as you dont want it using memory and slowing
> your  phone....
>
> Alberto
>
> On Dec 8, 5:11 pm, "Mark Murphy" <mmur...@commonsware.com> wrote:
>
> > > For example, in your browser, if you have been opening many pages, and
> > > then you click on "Back", it takes you to the previous page in the
> > > browser's history. Say, my history has 10 pages, so to finally exit
> > > the application, I have to press back 10 times!!!!..
>
> > Press HOME, and you're done. Moreover, that's what Android is trying to
> > teach users to do -- press HOME, and they're done.
>
> > Remember: everybody keeps holding iPhone up as perfection for user design,
> > and applications there do not have normally an "exit" option AFAICT. Users
> > just press The One And Only Button, and they're done. (Note: my iPod Touch
> > hasn't been, er, touched since before the OS 3.0 upgrade, so perhaps they
> > changed their UI approach recently and I missed it).
>
> > So, just make sure your app behaves the way you want when the user presses
> > HOME, and you're done.
>
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com
> > Android App Developer Books:http://commonsware.com/books.html
>
>

-- 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to