I'm doing a test application that has 1 edit and a textview, the edit text will have a value inside initial 0, when I click on the textview, I want it to increase to 10.00, and if I click again increase to 20, and so on
teste = findViewById(R.id.add10);
teste2 = findViewById(R.id.editText);
teste.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
int a=Integer.parseInt(teste2.getText().toString());
int b=a+10;
teste2.setText(new Integer(b).toString());
}
});
}
}
Follow logcat
01-22 10:23:48.987 8645-8645/com.example.gabriel.teste E/BoostFramework: BoostFramework() : Exception_1 = java.lang.ClassNotFoundException: Didn't find class "com.qualcomm.qti.Performance" on path: DexPathList[[],nativeLibraryDirectories=[/system/lib, /vendor/lib]]
01-22 10:23:49.100 8645-8645/com.example.gabriel.teste E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.gabriel.teste, PID: 8645
java.lang.NumberFormatException: For input string: "Name"
at java.lang.Integer.parseInt(Integer.java:521)
at java.lang.Integer.parseInt(Integer.java:556)
at com.example.gabriel.teste.MainActivity$1.onClick(MainActivity.java:25)
at android.view.View.performClick(View.java:6261)
at android.widget.TextView.performClick(TextView.java:11159)
at android.view.View$PerformClick.run(View.java:23748)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)