Saturday 15 September 2012

Java Null Pointer exception error on android app -



Java Null Pointer exception error on android app -

--- , guys way smarter me!!!

i having problem addressing error. app crashing due a null pointer exception.

here error:

java.lang.arrayindexoutofboundsexception: length=6; index=6 @ net.miraath.anbiyaa.simplemusicstream.updateaudioinfo(simplemusicstream.java:524) @ net.miraath.anbiyaa.simplemusicstream.access$1400(simplemusicstream.java:30) @ net.miraath.anbiyaa.simplemusicstream$audioinfoloadtask.onpostexecute(simplemusicstream.java:651) @ net.miraath.anbiyaa.simplemusicstream$audioinfoloadtask.onpostexecute(simplemusicstream.java:596) @ android.os.asynctask.finish(asynctask.java:631) @ android.os.asynctask.access$600(asynctask.java:177) @ android.os.asynctask$internalhandler.handlemessage(asynctask.java:644) @ android.os.handler.dispatchmessage(handler.java:99) @ android.os.looper.loop(looper.java:137) @ android.app.activitythread.main(activitythread.java:4745) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:511) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:786) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:553) @ dalvik.system.nativestart.main(native method) 10-25 12:36:30.275 1560-1560/net.miraath.anbiyaa e/trace﹕ error opening trace file: no such file or directory (2) 10-25 12:36:30.275 1560-1560/net.miraath.anbiyaa d/androidruntime﹕ shutting downwards vm 10-25 12:36:30.275 1560-1560/net.miraath.anbiyaa w/dalvikvm﹕ threadid=1: thread exiting uncaught exception (group=0xb2ed3288) 10-25 12:36:30.275 1560-1560/net.miraath.anbiyaa e/androidruntime﹕ fatal exception: main java.lang.runtimeexception: unable start service net.miraath.anbiyaa.playerservice@b3962930 null: java.lang.nullpointerexception @ android.app.activitythread.handleserviceargs(activitythread.java:2507) @ android.app.activitythread.access$1900(activitythread.java:130) @ android.app.activitythread$h.handlemessage(activitythread.java:1292) @ android.os.handler.dispatchmessage(handler.java:99) @ android.os.looper.loop(looper.java:137) @ android.app.activitythread.main(activitythread.java:4745) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:511) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:786) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:553) @ dalvik.system.nativestart.main(native method) caused by: java.lang.nullpointerexception @ net.miraath.anbiyaa.playerservice.onstart(playerservice.java:117) @ android.app.service.onstartcommand(service.java:450) @ android.app.activitythread.handleserviceargs(activitythread.java:2490)             at android.app.activitythread.access$1900(activitythread.java:130)             at android.app.activitythread$h.handlemessage(activitythread.java:1292)             at android.os.handler.dispatchmessage(handler.java:99)             at android.os.looper.loop(looper.java:137)             at android.app.activitythread.main(activitythread.java:4745)             at java.lang.reflect.method.invokenative(native method)             at java.lang.reflect.method.invoke(method.java:511)             at com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:786)             at com.android.internal.os.zygoteinit.main(zygoteinit.java:553)             at dalvik.system.nativestart.main(native method)

gere pulling hair out: same code works on other radios , doesn't crash!!!

any ideas???

here code:

audiotitle.settext(infos[0]); listenernomber.settext("" + getresources().getstring(r.string.lable_listiner_nomber)+": " + infos[0]); audiototaltime.settext(infos[5] + "k"); if(!infos[6].equals(stationoldaudiotitle)){ ((miraathradio)getapplication()).intnotification(stationtitle.gettext(), stationtitle.gettext(), infos[6], stationindex); stationoldaudiotitle = infos[6]; }

here code playerserver.class file:

stationurl = intent.getstringextra("stationurl"); stationname = intent.getstringextra("stationname"); stationindex = intent.getintextra("stationindex",0); charsequence stationaudiotitle = intent.getstringextra("stationaudiotitle");

update: forgot mention 1 key behaving in this: when not press ok on scheme dialog box pops result of exception, app continues work in background. when click ok app crashes , app closes.

i don't know infos initialized, based on exception (java.lang.arrayindexoutofboundsexception: length=6; index=6), has length of 6, , hence infos[6] out of array bounds.

java android

No comments:

Post a Comment