Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid AppBreaking Method Call
    text
    copied!<p>I have this method called Checker that gets called when I click a button but my app stops working. I have tried adding the try catch to see the exception but I cannot understand why it is not working... Below the method I have put the log cat of the errors:</p> <pre><code> public void Checker() { EditText text = (EditText) findViewById(R.id.editText1); int in = Integer.parseInt(text.getText().toString()); try{ if(MainActivity.result == in) { ProgressBar bar = (ProgressBar) findViewById(R.id.seekBar1); MainActivity.progress = (MainActivity.progress + 1); bar.setProgress(MainActivity.progress); } else { text.setBackgroundColor(Color.RED); } }catch(Exception e){System.out.println(e);} } </code></pre> <p>LogCat:</p> <pre><code>FATAL EXCEPTION: main java.lang.IllegalStateException: Could not find a method Checker(View) in the activity class com.taffatech.kidsapp.GameActivity for onClick handler on view class android.widget.Button with id 'btnQuestion' at android.view.View$1.onClick(View.java:3090) at android.view.View.performClick(View.java:3574) at android.view.View$PerformClick.run(View.java:14293) at android.os.Handler.handleCallback(Handler.java:605) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4441) 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:823) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590) at dalvik.system.NativeStart.main(Native Method) HERE: Caused by: java.lang.NoSuchMethodException: Checker [class android.view.View] at java.lang.Class.getConstructorOrMethod(Class.java:460) at java.lang.Class.getMethod(Class.java:915) at android.view.View$1.onClick(View.java:3083) </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload