Mitch wrote: > I'm trying start a new Activity from my current one. Every place I > look for example code is different, but the result is the same. The > code brings up the following dialog: > > ===== > Sorry! > > The application MyApp (process com.example.mypackage) has stopped > unexpectedly. Please try again. > > [Force close] > =====
Use adb logcat, DDMS, or the DDMS perspective in Eclipse to look at the Java stack trace associated with this dialog. That will tell you what is going wrong. Most likely, there is a problem in your second Activity. > Here's one of the things I tried (among dozens) which causes this: > > Intent myIntent = new Intent(this, NextActivity.class); > startActivity(myIntent); That is perfectly fine, assuming that NextActivity is registered in your manifest. > Does anyone have a link to simple example that starts up a new > activity that is complete and works? There are 43 total calls to startActivity() from the sample code that shipped with your SDK. Visit $ANDROID_HOME/platforms/$SDK/samples, where $ANDROID_HOME is wherever you installed your SDK and $SDK is some SDK version (e.g., android-2.1). Also, the Notepad tutorial has multiple activities: http://developer.android.com/resources/tutorials/notepad/index.html -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.0 Available! -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en

