checkbox - Checkboxes and intent -


i having issue multiple checkboxes. situation this, have 5 check boxes , when check 2 of them, 1 activity start if check 2 other other activity start. issue when check checkbox1 application crashes. if have ideas, guest :)

package com.example.matematikanapredna; import android.os.bundle; import android.app.activity; import android.content.intent; import android.view.menu; import android.view.view; import android.widget.button; import android.widget.checkbox;  public class pravougaonik extends activity {  @override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_pravougaonik);      final checkbox checkbox1=(checkbox) findviewbyid(r.id.checkbox1);     final checkbox checkbox2=(checkbox) findviewbyid(r.id.checkbox01);     final checkbox checkbox3=(checkbox) findviewbyid(r.id.checkbox2);     final checkbox checkbox4=(checkbox) findviewbyid(r.id.checkbox3);     final checkbox checkbox5=(checkbox) findviewbyid(r.id.checkbox4);      button nastavi=(button) findviewbyid(r.id.button1);      nastavi.setonclicklistener (new view.onclicklistener() {          @override         public void onclick(view v) {             if (checkbox1.ischecked()==true && checkbox2.ischecked()==true) {                 intent i=new intent (v.getcontext(), pravougaonikstranica.class);                 startactivity(i);                 checkbox1.toggle();                 checkbox2.toggle();             }          }         });  }   } 

here logcat output:

07-11 14:26:13.507: i/process(26961): sending signal. pid: 26961 sig: 9 07-11 14:27:45.067: d/dalvikvm(28468): gc_for_alloc freed 68k, 6% free 12194k/12867k, paused 30ms, total 30ms 07-11 14:27:45.072: i/dalvikvm-heap(28468): grow heap (frag case) 13.031mb 614416-byte allocation 07-11 14:27:45.107: d/dalvikvm(28468): gc_concurrent freed 1k, 6% free 12793k/13511k, paused 17ms+2ms, total 35ms 07-11 14:27:45.107: d/dalvikvm(28468): wait_for_concurrent_gc blocked 10ms 07-11 14:27:45.122: d/dalvikvm(28468): gc_for_alloc freed 0k, 6% free 12793k/13511k, paused 15ms, total 15ms 07-11 14:27:45.127: i/dalvikvm-heap(28468): grow heap (frag case) 14.072mb 1093136-byte allocation 07-11 14:27:45.152: d/dalvikvm(28468): gc_concurrent freed 0k, 6% free 13860k/14599k, paused 15ms+3ms, total 29ms 07-11 14:27:45.152: d/dalvikvm(28468): wait_for_concurrent_gc blocked 11ms 07-11 14:27:45.247: d/libegl(28468): loaded /system/lib/egl/libegl_mali.so 07-11 14:27:45.257: d/libegl(28468): loaded /system/lib/egl/libglesv1_cm_mali.so 07-11 14:27:45.262: d/libegl(28468): loaded /system/lib/egl/libglesv2_mali.so 07-11 14:27:45.267: d/(28468): device driver api match 07-11 14:27:45.267: d/(28468): device driver api version: 10 07-11 14:27:45.267: d/(28468): user space api version: 10  07-11 14:27:45.267: d/(28468): mali: revision=linux-r2p4-02rel0 build_date=tue oct 16 15:37:13 kst 2012  07-11 14:27:45.302: d/openglrenderer(28468): enabling debug mode 0 07-11 14:27:47.007: e/spannablestringbuilder(28468): span_exclusive_exclusive spans cannot have 0 length 07-11 14:27:47.007: e/spannablestringbuilder(28468): span_exclusive_exclusive spans cannot have 0 length 07-11 14:27:47.747: d/androidruntime(28468): shutting down vm 07-11 14:27:47.747: w/dalvikvm(28468): threadid=1: thread exiting uncaught exception (group=0x418622a0) 07-11 14:27:47.762: e/androidruntime(28468): fatal exception: main 07-11 14:27:47.762: e/androidruntime(28468): java.lang.illegalstateexception: not find method oncheckboxclicked(view) in activity class com.example.matematikanapredna.pravougaonik onclick handler on view class android.widget.checkbox id 'checkbox1' 07-11 14:27:47.762: e/androidruntime(28468):    @ android.view.view$1.onclick(view.java:3678) 07-11 14:27:47.762: e/androidruntime(28468):    @ android.view.view.performclick(view.java:4211) 07-11 14:27:47.762: e/androidruntime(28468):    @ android.widget.compoundbutton.performclick(compoundbutton.java:105) 07-11 14:27:47.762: e/androidruntime(28468):    @ android.view.view$performclick.run(view.java:17267) 07-11 14:27:47.762: e/androidruntime(28468):    @ android.os.handler.handlecallback(handler.java:615) 07-11 14:27:47.762: e/androidruntime(28468):    @ android.os.handler.dispatchmessage(handler.java:92) 07-11 14:27:47.762: e/androidruntime(28468):    @ android.os.looper.loop(looper.java:137) 07-11 14:27:47.762: e/androidruntime(28468):    @ android.app.activitythread.main(activitythread.java:4898) 07-11 14:27:47.762: e/androidruntime(28468):    @ java.lang.reflect.method.invokenative(native method) 07-11 14:27:47.762: e/androidruntime(28468):    @ java.lang.reflect.method.invoke(method.java:511) 07-11 14:27:47.762: e/androidruntime(28468):    @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1006) 07-11 14:27:47.762: e/androidruntime(28468):    @ com.android.internal.os.zygoteinit.main(zygoteinit.java:773) 07-11 14:27:47.762: e/androidruntime(28468):    @ dalvik.system.nativestart.main(native method) 07-11 14:27:47.762: e/androidruntime(28468): caused by: java.lang.nosuchmethodexception: oncheckboxclicked [class android.view.view] 07-11 14:27:47.762: e/androidruntime(28468):    @ java.lang.class.getconstructorormethod(class.java:460) 07-11 14:27:47.762: e/androidruntime(28468):    @ java.lang.class.getmethod(class.java:915) 07-11 14:27:47.762: e/androidruntime(28468):    @ android.view.view$1.onclick(view.java:3671) 07-11 14:27:47.762: e/androidruntime(28468):    ... 12 more 

an error message (logcat output) helpful. did try cleaning project? r.java gets messed leads classcastexceptions...


Comments