My code runs fine on my Motorola Droid but when i run it on the emulator i get this stack trace:
07-05 14:29:23.035: ERROR/AndroidRuntime(237): Uncaught handler: thread main exiting due to uncaught exception
07-05 14:29:23.075: ERROR/AndroidRuntime(237): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.thinknao.wordlands/com.thinknao.wordlands.OptionsPage}: android.view.InflateException: Binary XML file line #16: Error inflating class java.lang.reflect.Constructor
07-05 14:29:23.075: ERROR/AndroidRuntime(237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)
07-05 14:29:23.075: ERROR/AndroidRuntime(237): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
07-05 14:29:23.075: ERROR/AndroidRuntime(237): Caused by: android.view.InflateException: Binary XML file line #16: Error inflating class java.lang.reflect.Constructor
07-05 14:29:23.075: ERROR/AndroidRuntime(237): at android.view.LayoutInflater.createView(LayoutInflater.java:512)
07-05 14:29:23.075: ERROR/AndroidRuntime(237): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
07-05 14:29:23.075: ERROR/AndroidRuntime(237): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)
07-05 14:29:23.075: ERROR/AndroidRuntime(237): Caused by: java.lang.reflect.InvocationTargetException
07-05 14:29:23.075: ERROR/AndroidRuntime(237): at android.widget.Button.<init>(Button.java:65)
07-05 14:29:23.075: ERROR/AndroidRuntime(237): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
07-05 14:29:23.075: ERROR/AndroidRuntime(237): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
It’s difficult to be exact without seeing your code and layout, but you are running out of memory. It looks to be concerned with the loading of a bitmap object, one that is referenced on line 16 of your layout file.
I would suggest that either you are using a very large image file; you are using lots of images; or a combination of the two.
The reason that it runs on the Droid but not on the emulator is, most likely, that the emulator has been configured with less memory than the phone. You can change your emulator settings in the AVD manager.