Monday, August 15, 2011

Re: [android-developers] back & home key in api

On Mon, Aug 15, 2011 at 5:13 AM, mark2011 <androidmark2011@gmail.com> wrote:
>    I want to set the back & home function in my API.

That sentence is unclear.

> I use finish or system.exit(0) to return my last page.

Do not use System.exit(0) in any production-grade Android application.

> How do I go back to my home page?

Call startActivity() with an Intent identifying your home page,
perhaps with appropriate flags to control the stack (e.g.,
FLAG_ACTIVITY_CLEAR_TOP|FLAG_ACTIVITY_SINGLE_TOP).

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate