java - Null pointer exception when adding TextView -


i have scrollview, , i'm trying add textviews linearlayout in keep getting error.

textview l = new textview(stopwatch.this); l.settext("didn't work"); l.settextsize(20); lllocations.addview(l); 

i trying use code see if arraylist using empty, wasnt that. says error caused nullpointerexception at...

lllocations.addview(l); 

i have other code same thing, , tried comparing them there wasn't difference i'm confused. how fix this?

07-10 21:14:42.687: e/androidruntime(5241): fatal exception: main 07-10 21:14:42.687: e/androidruntime(5241): java.lang.illegalstateexception: not execute method of activity 07-10 21:14:42.687: e/androidruntime(5241):     @ android.view.view$1.onclick(view.java:3599) 07-10 21:14:42.687: e/androidruntime(5241):     @ android.view.view.performclick(view.java:4204) 07-10 21:14:42.687: e/androidruntime(5241):     @ android.view.view$performclick.run(view.java:17355) 07-10 21:14:42.687: e/androidruntime(5241):     @ android.os.handler.handlecallback(handler.java:725) 07-10 21:14:42.687: e/androidruntime(5241):     @ android.os.handler.dispatchmessage(handler.java:92) 07-10 21:14:42.687: e/androidruntime(5241):     @ android.os.looper.loop(looper.java:137) 07-10 21:14:42.687: e/androidruntime(5241):     @ android.app.activitythread.main(activitythread.java:5041) 07-10 21:14:42.687: e/androidruntime(5241):     @ java.lang.reflect.method.invokenative(native method) 07-10 21:14:42.687: e/androidruntime(5241):     @ java.lang.reflect.method.invoke(method.java:511) 07-10 21:14:42.687: e/androidruntime(5241):     @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:793) 07-10 21:14:42.687: e/androidruntime(5241):     @ com.android.internal.os.zygoteinit.main(zygoteinit.java:560) 07-10 21:14:42.687: e/androidruntime(5241):     @ dalvik.system.nativestart.main(native method) 07-10 21:14:42.687: e/androidruntime(5241): caused by: java.lang.reflect.invocationtargetexception 07-10 21:14:42.687: e/androidruntime(5241):     @ java.lang.reflect.method.invokenative(native method) 07-10 21:14:42.687: e/androidruntime(5241):     @ java.lang.reflect.method.invoke(method.java:511) 07-10 21:14:42.687: e/androidruntime(5241):     @ android.view.view$1.onclick(view.java:3594) 07-10 21:14:42.687: e/androidruntime(5241):     ... 11 more 07-10 21:14:42.687: e/androidruntime(5241): caused by: java.lang.nullpointerexception 07-10 21:14:42.687: e/androidruntime(5241):     @ com.tbjsoft.runprogress.stopwatch.done(stopwatch.java:506) 07-10 21:14:42.687: e/androidruntime(5241):     ... 14 more 

stopwath.java:506 the

lllocations.addview(l); 

line.

i'm trying in alert dialog has custom view scroll view in it. think causing problem?

lllocations null. read on findviewbyid. end.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -