java - Android Emulator is Force Closing -


my android emulator force quitting program every time try run it. have no idea why, please me!

public class asteroidstoo extends activity { public void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);      new asteroidworld(3).bigbang(this);     } 

}

here logcat errors:

07-02 17:27:54.873: warn/dalvikvm(332): threadid=1: thread exiting uncaught exception (group=0x4001d800) 07-02 17:27:54.893: error/androidruntime(332): fatal exception: main 07-02 17:27:54.893: error/androidruntime(332): java.lang.runtimeexception: unable start activity componentinfo{foo.asteroidstoo/foo.asteroidstoo.asteroidstoo}: java.lang.nullpointerexception 07-02 17:27:54.893: error/androidruntime(332):     @ android.app.activitythread.performlaunchactivity(activitythread.java:2663) 07-02 17:27:54.893: error/androidruntime(332):     @ android.app.activitythread.handlelaunchactivity(activitythread.java:2679) 07-02 17:27:54.893: error/androidruntime(332):     @ android.app.activitythread.access$2300(activitythread.java:125) 07-02 17:27:54.893: error/androidruntime(332):     @ android.app.activitythread$h.handlemessage(activitythread.java:2033) 07-02 17:27:54.893: error/androidruntime(332):     @ android.os.handler.dispatchmessage(handler.java:99) 07-02 17:27:54.893: error/androidruntime(332):     @ android.os.looper.loop(looper.java:123) 07-02 17:27:54.893: error/androidruntime(332):     @ android.app.activitythread.main(activitythread.java:4627) 07-02 17:27:54.893: error/androidruntime(332):     @ java.lang.reflect.method.invokenative(native method) 07-02 17:27:54.893: error/androidruntime(332):     @ java.lang.reflect.method.invoke(method.java:521) 07-02 17:27:54.893: error/androidruntime(332):     @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:868) 07-02 17:27:54.893: error/androidruntime(332):     @ com.android.internal.os.zygoteinit.main(zygoteinit.java:626) 07-02 17:27:54.893: error/androidruntime(332):     @ dalvik.system.nativestart.main(native method) 07-02 17:27:54.893: error/androidruntime(332): caused by: java.lang.nullpointerexception 07-02 17:27:54.893: error/androidruntime(332):     @ java.util.hashtable.put(hashtable.java:369) 07-02 17:27:54.893: error/androidruntime(332):     @ android.image.fromfile.<init>(fromfile.java:25) 07-02 17:27:54.893: error/androidruntime(332):     @ foo.asteroidstoo.ship.<init>(asteroidstoo.java:75) 07-02 17:27:54.893: error/androidruntime(332):     @ foo.asteroidstoo.asteroidworld.<init>(asteroidstoo.java:196) 07-02 17:27:54.893: error/androidruntime(332):     @ foo.asteroidstoo.asteroidstoo.oncreate(asteroidstoo.java:13) 07-02 17:27:54.893: error/androidruntime(332):     @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1047) 07-02 17:27:54.893: error/androidruntime(332):     @ android.app.activitythread.performlaunchactivity(activitythread.java:2627) 07-02 17:27:54.893: error/androidruntime(332):     ... 11 more 07-02 17:27:54.923: warn/activitymanager(59):   force finishing activity foo.asteroidstoo/.asteroidstoo 07-02 17:27:55.433: warn/activitymanager(59): activity pause timeout historyrecord{45053848 foo.asteroidstoo/.asteroidstoo} 07-02 17:28:03.173: warn/inputmanagerservice(59): window focused, ignoring focus gain of: com.android.internal.view.iinputmethodclient$stub$proxy@44f2b9d8 07-02 17:28:06.287: warn/activitymanager(59): activity destroy timeout historyrecord{45053848 foo.asteroidstoo/.asteroidstoo} 

here code constructor:

/**represents world*/ class asteroidworld extends voidworld{     ship sh;     arraylist<bullet> b;     arraylist<asteroids> a;     int score;     int highscore;     state state;     int lives;     double timer;      public asteroidworld(int lives) {         super();         this.sh = new ship(300.0,300.0,0.0,0.0,90.0);         this.b = new arraylist<bullet>();         this.a = new arraylist<asteroids>();         this.score = 0;         this.highscore = 0;         this.timer = 3.0;         this.state = new lose();         this.lives = lives; 

i error saying:

[2011-07-02 20:08:08 - emulator] 2011-07-02 20:08:08.156 emulator[14734:903] warning once: application, or library uses, using nsquickdrawview, has been deprecated. apps should cease use of quickdraw , move quartz

here ship constructor

/**represents ship in game*/ class ship extends floatobject{ image spaceship = new fromfile("spaceship.png"); double angle; double speed = 2; 

my guess that, in ship's constructor, not showing, line in create new instance of fromfile, passing null value fromfile's constructor. fromfile's constructor expects string. might attempting pass string it, whatever getting there null.

fromfile's constructor putting value hashtable, , value null instead of expecting. that's can gather not being able see necessary here.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -