*> I took this from an example app.* What example app? *> What do you suggest I do instead when user wants to quit the app?* Depends on what your app is... since you haven't provided many details I can't really give a good example. An activity, for example, provides a finish() method that you call to finish the activity.
*> And why would system.exit(0) has anything to do with the error message?* Android applications are not typical programs... For example, there is no main() method. The Android OS controls the lifecycle of the applications. If you are doing something that the Android OS is not expecting it could cause all sorts of problems. http://developer.android.com/guide/topics/fundamentals/activities.html#Lifecycle Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware On Fri, May 6, 2011 at 11:48 AM, redmapleleaf <[email protected]>wrote: > Hi Justin, > > I took this from an example app. What do you suggest I do instead when > user wants to quit the app? > > And why would system.exit(0) has anything to do with the error > message? > > Thanks, > > On May 6, 11:04 am, Justin Anderson <[email protected]> wrote: > > Why are you calling system.exit(0)? I can't think of a single case in > > Android where you would want to do that (Doesn't mean there isn't a > case... > > I've just never come across the need). > > > > What does your logcat output say in regards to the error? > > > > Thanks, > > Justin Anderson > > MagouyaWare Developerhttp://sites.google.com/site/magouyaware > > > > > > > > > > > > > > > > On Fri, May 6, 2011 at 6:50 AM, redmapleleaf <[email protected]> > wrote: > > > Hi all, > > > I have an application that received gmail broadcast messages. I > > > registered the broadcast receiver in the android manifest file. My app > > > is able to receive the gmail well. However when the user press the > > > button to quit the app (at which point i call system.exit(0) ) then if > > > an email is sent to his gmail account then the error message > > > > > "The application myapp has stopped unexpectedly. please try again" > > > > > appeared on the screen. > > > > > Do you know if there is a way to prevent this problem? > > > > > Thank you. > > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Android Developers" group. > > > To post to this group, send email to > [email protected] > > > 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 > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > 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 > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] 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

