On Thu, Aug 25, 2011 at 6:27 PM, Steven P <[email protected]> wrote:
> I'm trying to add a button that can pause the threads that run my game. It > looks like I can basically copy paste the button example, but it doesn't > work. > Rarely can you copy examples into your code and have it work perfectly. > It runs perfectly without the button object > creation/onclicklistener setting, but with it added it crashes. Am I doing > something wrong? > Well ... your app IS crashing, so I think it's safe to say you're doing something wrong =P The *what* you're doing wrong can be determined from the stack trace: 08-25 19:22:18.126: ERROR/AndroidRuntime(951): Caused by: java.lang.reflect.InvocationTargetException 08-25 19:22:18.126: ERROR/AndroidRuntime(951): at parachute.game.ParachuteActivity.newGame(ParachuteActivity.java:27) 08-25 19:22:18.126: ERROR/AndroidRuntime(951): Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class parachute.game.GameView ... 08-25 19:22:18.126: ERROR/AndroidRuntime(951): at android.app.Activity.setContentView(Activity.java:1647) 08-25 19:22:18.126: ERROR/AndroidRuntime(951): Caused by: java.lang.reflect.InvocationTargetException 08-25 19:22:18.126: ERROR/AndroidRuntime(951): at parachute.game.GameView.<init>(GameView.java:46) 08-25 19:22:18.126: ERROR/AndroidRuntime(951): Caused by: java.lang.NullPointerException 08-25 19:22:18.126: ERROR/AndroidRuntime(951): ... 26 more Now whip out that debugger and get to work. ------------------------------------------------------------------------------------------------- TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago transit tracking app for Android-powered devices -- 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

