# Android Taschenrechner



## Pixel1337 (25. Jan 2012)

Hallo,

ich versuche gerade meine erste App zu programmieren aber komme überhaupt nicht weiter.
Wenn ich den "+" Button Click sollte das Ergebnis addiert werden und in ein Feld eingetragen doch es kommt folgende Fehlermeldung: "Unfortunately, Taschenrechner has stopped".


```
package de.taschenrechner.steffen;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class TaschenrechnerActivity extends Activity implements android.view.View.OnClickListener {
    /** Called when the activity is first created. */
	
	private Button bplus, bminus;
	private TextView zahl1, zahl2, ergebnis_f;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        zahl1 = (TextView) findViewById(R.id.ezahl1);
        zahl1 = (TextView) findViewById(R.id.ezahl2);
        ergebnis_f = (TextView) findViewById(R.id.ergebnis);
        
        bplus = (Button) findViewById(R.id.bplus);
        bminus = (Button) findViewById(R.id.Bminus);
        
        bplus.setOnClickListener(this);
        bminus.setOnClickListener(this);
        
        
    }

	public void onClick(View v) {
		float z1 = Float.parseFloat(zahl1.getText().toString());
		float z2 = Float.parseFloat(zahl2.getText().toString());
		float erg = 0;
		
		if(v == bplus) {
			erg = z1 + z2;
		}
		else if(v == bminus) {
			erg = z1 - z2;
		}
		ergebnis_f.setText(""+erg);
	}

}
```

Könnt ihr mir nen Tipp geben?


----------



## Plopo (25. Jan 2012)

Was sagt den der LogCat, wenn die Fehlermeldung: "Unfortunately, Taschenrechner has stopped" kommt?


----------



## Pixel1337 (25. Jan 2012)

```
01-25 09:57:04.118: D/gralloc_goldfish(581): Emulator without GPU emulation detected.
01-25 09:57:14.680: W/IInputConnectionWrapper(581): showStatusIcon on inactive InputConnection
01-25 10:08:09.958: D/gralloc_goldfish(675): Emulator without GPU emulation detected.
01-25 10:08:11.348: W/IInputConnectionWrapper(675): showStatusIcon on inactive InputConnection
01-25 10:28:40.549: W/IInputConnectionWrapper(675): showStatusIcon on inactive InputConnection
01-25 10:38:07.530: D/gralloc_goldfish(748): Emulator without GPU emulation detected.
01-25 10:38:14.008: D/AndroidRuntime(748): Shutting down VM
01-25 10:38:14.008: W/dalvikvm(748): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-25 10:38:14.028: E/AndroidRuntime(748): FATAL EXCEPTION: main
01-25 10:38:14.028: E/AndroidRuntime(748): java.lang.NullPointerException
01-25 10:38:14.028: E/AndroidRuntime(748): 	at de.taschenrechner.steffen.TaschenrechnerActivity.onClick(TaschenrechnerActivity.java:35)
01-25 10:38:14.028: E/AndroidRuntime(748): 	at android.view.View.performClick(View.java:3511)
01-25 10:38:14.028: E/AndroidRuntime(748): 	at android.view.View$PerformClick.run(View.java:14105)
01-25 10:38:14.028: E/AndroidRuntime(748): 	at android.os.Handler.handleCallback(Handler.java:605)
01-25 10:38:14.028: E/AndroidRuntime(748): 	at android.os.Handler.dispatchMessage(Handler.java:92)
01-25 10:38:14.028: E/AndroidRuntime(748): 	at android.os.Looper.loop(Looper.java:137)
01-25 10:38:14.028: E/AndroidRuntime(748): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
01-25 10:38:14.028: E/AndroidRuntime(748): 	at java.lang.reflect.Method.invokeNative(Native Method)
01-25 10:38:14.028: E/AndroidRuntime(748): 	at java.lang.reflect.Method.invoke(Method.java:511)
01-25 10:38:14.028: E/AndroidRuntime(748): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-25 10:38:14.028: E/AndroidRuntime(748): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-25 10:38:14.028: E/AndroidRuntime(748): 	at dalvik.system.NativeStart.main(Native Method)
01-25 10:39:13.038: D/gralloc_goldfish(764): Emulator without GPU emulation detected.
01-25 10:39:25.548: D/AndroidRuntime(764): Shutting down VM
01-25 10:39:25.548: W/dalvikvm(764): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-25 10:39:25.569: E/AndroidRuntime(764): FATAL EXCEPTION: main
01-25 10:39:25.569: E/AndroidRuntime(764): java.lang.NullPointerException
01-25 10:39:25.569: E/AndroidRuntime(764): 	at de.taschenrechner.steffen.TaschenrechnerActivity.onClick(TaschenrechnerActivity.java:35)
01-25 10:39:25.569: E/AndroidRuntime(764): 	at android.view.View.performClick(View.java:3511)
01-25 10:39:25.569: E/AndroidRuntime(764): 	at android.view.View$PerformClick.run(View.java:14105)
01-25 10:39:25.569: E/AndroidRuntime(764): 	at android.os.Handler.handleCallback(Handler.java:605)
01-25 10:39:25.569: E/AndroidRuntime(764): 	at android.os.Handler.dispatchMessage(Handler.java:92)
01-25 10:39:25.569: E/AndroidRuntime(764): 	at android.os.Looper.loop(Looper.java:137)
01-25 10:39:25.569: E/AndroidRuntime(764): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
01-25 10:39:25.569: E/AndroidRuntime(764): 	at java.lang.reflect.Method.invokeNative(Native Method)
01-25 10:39:25.569: E/AndroidRuntime(764): 	at java.lang.reflect.Method.invoke(Method.java:511)
01-25 10:39:25.569: E/AndroidRuntime(764): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-25 10:39:25.569: E/AndroidRuntime(764): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-25 10:39:25.569: E/AndroidRuntime(764): 	at dalvik.system.NativeStart.main(Native Method)
01-25 10:40:06.908: I/Process(764): Sending signal. PID: 764 SIG: 9
01-25 10:44:36.688: D/gralloc_goldfish(813): Emulator without GPU emulation detected.
01-25 10:44:48.138: D/AndroidRuntime(813): Shutting down VM
01-25 10:44:48.138: W/dalvikvm(813): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-25 10:44:48.158: E/AndroidRuntime(813): FATAL EXCEPTION: main
01-25 10:44:48.158: E/AndroidRuntime(813): java.lang.NullPointerException
01-25 10:44:48.158: E/AndroidRuntime(813): 	at de.taschenrechner.steffen.TaschenrechnerActivity.onClick(TaschenrechnerActivity.java:36)
01-25 10:44:48.158: E/AndroidRuntime(813): 	at android.view.View.performClick(View.java:3511)
01-25 10:44:48.158: E/AndroidRuntime(813): 	at android.view.View$PerformClick.run(View.java:14105)
01-25 10:44:48.158: E/AndroidRuntime(813): 	at android.os.Handler.handleCallback(Handler.java:605)
01-25 10:44:48.158: E/AndroidRuntime(813): 	at android.os.Handler.dispatchMessage(Handler.java:92)
01-25 10:44:48.158: E/AndroidRuntime(813): 	at android.os.Looper.loop(Looper.java:137)
01-25 10:44:48.158: E/AndroidRuntime(813): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
01-25 10:44:48.158: E/AndroidRuntime(813): 	at java.lang.reflect.Method.invokeNative(Native Method)
01-25 10:44:48.158: E/AndroidRuntime(813): 	at java.lang.reflect.Method.invoke(Method.java:511)
01-25 10:44:48.158: E/AndroidRuntime(813): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-25 10:44:48.158: E/AndroidRuntime(813): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-25 10:44:48.158: E/AndroidRuntime(813): 	at dalvik.system.NativeStart.main(Native Method)
01-25 10:44:55.118: D/gralloc_goldfish(828): Emulator without GPU emulation detected.
01-25 10:46:57.180: W/ActivityThread(884): Application de.taschenrechner.steffen is waiting for the debugger on port 8100...
01-25 10:46:57.228: I/System.out(884): Sending WAIT chunk
01-25 10:47:01.644: I/dalvikvm(884): Debugger is active
01-25 10:47:01.843: I/System.out(884): Debugger has connected
01-25 10:47:01.843: I/System.out(884): waiting for debugger to settle...
01-25 10:47:02.060: I/System.out(884): waiting for debugger to settle...
01-25 10:47:02.258: I/System.out(884): waiting for debugger to settle...
01-25 10:47:02.490: I/System.out(884): waiting for debugger to settle...
01-25 10:47:02.702: I/System.out(884): waiting for debugger to settle...
01-25 10:47:02.915: I/System.out(884): waiting for debugger to settle...
01-25 10:47:03.130: I/System.out(884): waiting for debugger to settle...
01-25 10:47:03.346: I/System.out(884): waiting for debugger to settle...
01-25 10:47:03.559: I/System.out(884): waiting for debugger to settle...
01-25 10:47:03.772: I/System.out(884): waiting for debugger to settle...
01-25 10:47:03.983: I/System.out(884): waiting for debugger to settle...
01-25 10:47:04.196: I/System.out(884): waiting for debugger to settle...
01-25 10:47:04.412: I/System.out(884): waiting for debugger to settle...
01-25 10:47:04.625: I/System.out(884): waiting for debugger to settle...
01-25 10:47:04.838: I/System.out(884): waiting for debugger to settle...
01-25 10:47:05.050: I/System.out(884): waiting for debugger to settle...
01-25 10:47:05.261: I/System.out(884): waiting for debugger to settle...
01-25 10:47:05.476: I/System.out(884): waiting for debugger to settle...
01-25 10:47:05.688: I/System.out(884): waiting for debugger to settle...
01-25 10:47:05.899: I/System.out(884): waiting for debugger to settle...
01-25 10:47:06.112: I/System.out(884): waiting for debugger to settle...
01-25 10:47:06.325: I/System.out(884): waiting for debugger to settle...
01-25 10:47:06.540: I/System.out(884): waiting for debugger to settle...
01-25 10:47:06.746: I/System.out(884): waiting for debugger to settle...
01-25 10:47:06.972: I/System.out(884): waiting for debugger to settle...
01-25 10:47:07.181: I/System.out(884): waiting for debugger to settle...
01-25 10:47:07.387: I/System.out(884): waiting for debugger to settle...
01-25 10:47:07.594: I/System.out(884): waiting for debugger to settle...
01-25 10:47:07.799: I/System.out(884): debugger has settled (1328)
01-25 10:47:09.118: D/gralloc_goldfish(884): Emulator without GPU emulation detected.
01-25 10:49:15.976: D/AndroidRuntime(884): Shutting down VM
01-25 10:49:15.976: W/dalvikvm(884): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-25 10:49:16.030: E/AndroidRuntime(884): FATAL EXCEPTION: main
01-25 10:49:16.030: E/AndroidRuntime(884): java.lang.NullPointerException
01-25 10:49:16.030: E/AndroidRuntime(884): 	at de.taschenrechner.steffen.TaschenrechnerActivity.onClick(TaschenrechnerActivity.java:36)
01-25 10:49:16.030: E/AndroidRuntime(884): 	at android.view.View.performClick(View.java:3511)
01-25 10:49:16.030: E/AndroidRuntime(884): 	at android.view.View$PerformClick.run(View.java:14105)
01-25 10:49:16.030: E/AndroidRuntime(884): 	at android.os.Handler.handleCallback(Handler.java:605)
01-25 10:49:16.030: E/AndroidRuntime(884): 	at android.os.Handler.dispatchMessage(Handler.java:92)
01-25 10:49:16.030: E/AndroidRuntime(884): 	at android.os.Looper.loop(Looper.java:137)
01-25 10:49:16.030: E/AndroidRuntime(884): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
01-25 10:49:16.030: E/AndroidRuntime(884): 	at java.lang.reflect.Method.invokeNative(Native Method)
01-25 10:49:16.030: E/AndroidRuntime(884): 	at java.lang.reflect.Method.invoke(Method.java:511)
01-25 10:49:16.030: E/AndroidRuntime(884): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-25 10:49:16.030: E/AndroidRuntime(884): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-25 10:49:16.030: E/AndroidRuntime(884): 	at dalvik.system.NativeStart.main(Native Method)
01-25 11:00:36.398: W/ActivityThread(928): Application de.taschenrechner.steffen is waiting for the debugger on port 8100...
01-25 11:00:36.448: I/System.out(928): Sending WAIT chunk
01-25 11:00:36.468: I/dalvikvm(928): Debugger is active
01-25 11:00:36.648: I/System.out(928): Debugger has connected
01-25 11:00:36.648: I/System.out(928): waiting for debugger to settle...
01-25 11:00:36.848: I/System.out(928): waiting for debugger to settle...
01-25 11:00:37.058: I/System.out(928): waiting for debugger to settle...
01-25 11:00:37.288: I/System.out(928): waiting for debugger to settle...
01-25 11:00:37.488: I/System.out(928): waiting for debugger to settle...
01-25 11:00:37.698: I/System.out(928): waiting for debugger to settle...
01-25 11:00:37.898: I/System.out(928): waiting for debugger to settle...
01-25 11:00:38.098: I/System.out(928): waiting for debugger to settle...
01-25 11:00:38.300: I/System.out(928): debugger has settled (1428)
01-25 11:00:39.848: D/gralloc_goldfish(928): Emulator without GPU emulation detected.
01-25 11:01:12.823: D/AndroidRuntime(928): Shutting down VM
01-25 11:01:12.823: W/dalvikvm(928): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-25 11:01:12.878: E/AndroidRuntime(928): FATAL EXCEPTION: main
01-25 11:01:12.878: E/AndroidRuntime(928): java.lang.NullPointerException
01-25 11:01:12.878: E/AndroidRuntime(928): 	at de.taschenrechner.steffen.TaschenrechnerActivity.onClick(TaschenrechnerActivity.java:36)
01-25 11:01:12.878: E/AndroidRuntime(928): 	at android.view.View.performClick(View.java:3511)
01-25 11:01:12.878: E/AndroidRuntime(928): 	at android.view.View$PerformClick.run(View.java:14105)
01-25 11:01:12.878: E/AndroidRuntime(928): 	at android.os.Handler.handleCallback(Handler.java:605)
01-25 11:01:12.878: E/AndroidRuntime(928): 	at android.os.Handler.dispatchMessage(Handler.java:92)
01-25 11:01:12.878: E/AndroidRuntime(928): 	at android.os.Looper.loop(Looper.java:137)
01-25 11:01:12.878: E/AndroidRuntime(928): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
01-25 11:01:12.878: E/AndroidRuntime(928): 	at java.lang.reflect.Method.invokeNative(Native Method)
01-25 11:01:12.878: E/AndroidRuntime(928): 	at java.lang.reflect.Method.invoke(Method.java:511)
01-25 11:01:12.878: E/AndroidRuntime(928): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-25 11:01:12.878: E/AndroidRuntime(928): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-25 11:01:12.878: E/AndroidRuntime(928): 	at dalvik.system.NativeStart.main(Native Method)
01-25 11:07:32.539: D/gralloc_goldfish(975): Emulator without GPU emulation detected.
01-25 11:07:40.818: D/AndroidRuntime(975): Shutting down VM
01-25 11:07:40.818: W/dalvikvm(975): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-25 11:07:40.828: E/AndroidRuntime(975): FATAL EXCEPTION: main
01-25 11:07:40.828: E/AndroidRuntime(975): java.lang.NullPointerException
01-25 11:07:40.828: E/AndroidRuntime(975): 	at de.taschenrechner.steffen.TaschenrechnerActivity.onClick(TaschenrechnerActivity.java:37)
01-25 11:07:40.828: E/AndroidRuntime(975): 	at android.view.View.performClick(View.java:3511)
01-25 11:07:40.828: E/AndroidRuntime(975): 	at android.view.View$PerformClick.run(View.java:14105)
01-25 11:07:40.828: E/AndroidRuntime(975): 	at android.os.Handler.handleCallback(Handler.java:605)
01-25 11:07:40.828: E/AndroidRuntime(975): 	at android.os.Handler.dispatchMessage(Handler.java:92)
01-25 11:07:40.828: E/AndroidRuntime(975): 	at android.os.Looper.loop(Looper.java:137)
01-25 11:07:40.828: E/AndroidRuntime(975): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
01-25 11:07:40.828: E/AndroidRuntime(975): 	at java.lang.reflect.Method.invokeNative(Native Method)
01-25 11:07:40.828: E/AndroidRuntime(975): 	at java.lang.reflect.Method.invoke(Method.java:511)
01-25 11:07:40.828: E/AndroidRuntime(975): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-25 11:07:40.828: E/AndroidRuntime(975): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-25 11:07:40.828: E/AndroidRuntime(975): 	at dalvik.system.NativeStart.main(Native Method)
01-25 11:07:46.318: D/gralloc_goldfish(990): Emulator without GPU emulation detected.
01-25 11:07:49.998: D/AndroidRuntime(990): Shutting down VM
01-25 11:07:49.998: W/dalvikvm(990): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-25 11:07:50.018: E/AndroidRuntime(990): FATAL EXCEPTION: main
01-25 11:07:50.018: E/AndroidRuntime(990): java.lang.NullPointerException
01-25 11:07:50.018: E/AndroidRuntime(990): 	at de.taschenrechner.steffen.TaschenrechnerActivity.onClick(TaschenrechnerActivity.java:37)
01-25 11:07:50.018: E/AndroidRuntime(990): 	at android.view.View.performClick(View.java:3511)
01-25 11:07:50.018: E/AndroidRuntime(990): 	at android.view.View$PerformClick.run(View.java:14105)
01-25 11:07:50.018: E/AndroidRuntime(990): 	at android.os.Handler.handleCallback(Handler.java:605)
01-25 11:07:50.018: E/AndroidRuntime(990): 	at android.os.Handler.dispatchMessage(Handler.java:92)
01-25 11:07:50.018: E/AndroidRuntime(990): 	at android.os.Looper.loop(Looper.java:137)
01-25 11:07:50.018: E/AndroidRuntime(990): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
01-25 11:07:50.018: E/AndroidRuntime(990): 	at java.lang.reflect.Method.invokeNative(Native Method)
01-25 11:07:50.018: E/AndroidRuntime(990): 	at java.lang.reflect.Method.invoke(Method.java:511)
01-25 11:07:50.018: E/AndroidRuntime(990): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-25 11:07:50.018: E/AndroidRuntime(990): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-25 11:07:50.018: E/AndroidRuntime(990): 	at dalvik.system.NativeStart.main(Native Method)
01-25 11:07:53.748: I/Process(990): Sending signal. PID: 990 SIG: 9
01-25 11:08:14.249: D/gralloc_goldfish(1038): Emulator without GPU emulation detected.
01-25 11:08:18.528: D/AndroidRuntime(1038): Shutting down VM
01-25 11:08:18.528: W/dalvikvm(1038): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-25 11:08:18.548: E/AndroidRuntime(1038): FATAL EXCEPTION: main
01-25 11:08:18.548: E/AndroidRuntime(1038): java.lang.NullPointerException
01-25 11:08:18.548: E/AndroidRuntime(1038): 	at de.taschenrechner.steffen.TaschenrechnerActivity.onClick(TaschenrechnerActivity.java:37)
01-25 11:08:18.548: E/AndroidRuntime(1038): 	at android.view.View.performClick(View.java:3511)
01-25 11:08:18.548: E/AndroidRuntime(1038): 	at android.view.View$PerformClick.run(View.java:14105)
01-25 11:08:18.548: E/AndroidRuntime(1038): 	at android.os.Handler.handleCallback(Handler.java:605)
01-25 11:08:18.548: E/AndroidRuntime(1038): 	at android.os.Handler.dispatchMessage(Handler.java:92)
01-25 11:08:18.548: E/AndroidRuntime(1038): 	at android.os.Looper.loop(Looper.java:137)
01-25 11:08:18.548: E/AndroidRuntime(1038): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
01-25 11:08:18.548: E/AndroidRuntime(1038): 	at java.lang.reflect.Method.invokeNative(Native Method)
01-25 11:08:18.548: E/AndroidRuntime(1038): 	at java.lang.reflect.Method.invoke(Method.java:511)
01-25 11:08:18.548: E/AndroidRuntime(1038): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-25 11:08:18.548: E/AndroidRuntime(1038): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-25 11:08:18.548: E/AndroidRuntime(1038): 	at dalvik.system.NativeStart.main(Native Method)
01-25 11:08:21.928: I/Process(1038): Sending signal. PID: 1038 SIG: 9
01-25 11:10:46.468: D/gralloc_goldfish(1089): Emulator without GPU emulation detected.
01-25 11:10:51.088: D/AndroidRuntime(1089): Shutting down VM
01-25 11:10:51.088: W/dalvikvm(1089): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-25 11:10:51.109: E/AndroidRuntime(1089): FATAL EXCEPTION: main
01-25 11:10:51.109: E/AndroidRuntime(1089): java.lang.NullPointerException
01-25 11:10:51.109: E/AndroidRuntime(1089): 	at de.taschenrechner.steffen.TaschenrechnerActivity$1.onClick(TaschenrechnerActivity.java:36)
01-25 11:10:51.109: E/AndroidRuntime(1089): 	at android.view.View.performClick(View.java:3511)
01-25 11:10:51.109: E/AndroidRuntime(1089): 	at android.view.View$PerformClick.run(View.java:14105)
01-25 11:10:51.109: E/AndroidRuntime(1089): 	at android.os.Handler.handleCallback(Handler.java:605)
01-25 11:10:51.109: E/AndroidRuntime(1089): 	at android.os.Handler.dispatchMessage(Handler.java:92)
01-25 11:10:51.109: E/AndroidRuntime(1089): 	at android.os.Looper.loop(Looper.java:137)
01-25 11:10:51.109: E/AndroidRuntime(1089): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
01-25 11:10:51.109: E/AndroidRuntime(1089): 	at java.lang.reflect.Method.invokeNative(Native Method)
01-25 11:10:51.109: E/AndroidRuntime(1089): 	at java.lang.reflect.Method.invoke(Method.java:511)
01-25 11:10:51.109: E/AndroidRuntime(1089): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-25 11:10:51.109: E/AndroidRuntime(1089): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-25 11:10:51.109: E/AndroidRuntime(1089): 	at dalvik.system.NativeStart.main(Native Method)
01-25 11:11:00.188: I/Process(1089): Sending signal. PID: 1089 SIG: 9
01-25 11:13:07.688: D/gralloc_goldfish(1136): Emulator without GPU emulation detected.
01-25 11:13:14.328: D/AndroidRuntime(1136): Shutting down VM
01-25 11:13:14.328: W/dalvikvm(1136): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-25 11:13:14.348: E/AndroidRuntime(1136): FATAL EXCEPTION: main
01-25 11:13:14.348: E/AndroidRuntime(1136): java.lang.NullPointerException
01-25 11:13:14.348: E/AndroidRuntime(1136): 	at de.taschenrechner.steffen.TaschenrechnerActivity.onClick(TaschenrechnerActivity.java:35)
01-25 11:13:14.348: E/AndroidRuntime(1136): 	at android.view.View.performClick(View.java:3511)
01-25 11:13:14.348: E/AndroidRuntime(1136): 	at android.view.View$PerformClick.run(View.java:14105)
01-25 11:13:14.348: E/AndroidRuntime(1136): 	at android.os.Handler.handleCallback(Handler.java:605)
01-25 11:13:14.348: E/AndroidRuntime(1136): 	at android.os.Handler.dispatchMessage(Handler.java:92)
01-25 11:13:14.348: E/AndroidRuntime(1136): 	at android.os.Looper.loop(Looper.java:137)
01-25 11:13:14.348: E/AndroidRuntime(1136): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
01-25 11:13:14.348: E/AndroidRuntime(1136): 	at java.lang.reflect.Method.invokeNative(Native Method)
01-25 11:13:14.348: E/AndroidRuntime(1136): 	at java.lang.reflect.Method.invoke(Method.java:511)
01-25 11:13:14.348: E/AndroidRuntime(1136): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-25 11:13:14.348: E/AndroidRuntime(1136): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-25 11:13:14.348: E/AndroidRuntime(1136): 	at dalvik.system.NativeStart.main(Native Method)
01-25 11:16:55.919: D/gralloc_goldfish(1151): Emulator without GPU emulation detected.
01-25 11:16:59.168: D/AndroidRuntime(1151): Shutting down VM
01-25 11:16:59.168: W/dalvikvm(1151): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-25 11:16:59.179: E/AndroidRuntime(1151): FATAL EXCEPTION: main
01-25 11:16:59.179: E/AndroidRuntime(1151): java.lang.NullPointerException
01-25 11:16:59.179: E/AndroidRuntime(1151): 	at de.taschenrechner.steffen.TaschenrechnerActivity.onClick(TaschenrechnerActivity.java:35)
01-25 11:16:59.179: E/AndroidRuntime(1151): 	at android.view.View.performClick(View.java:3511)
01-25 11:16:59.179: E/AndroidRuntime(1151): 	at android.view.View$PerformClick.run(View.java:14105)
01-25 11:16:59.179: E/AndroidRuntime(1151): 	at android.os.Handler.handleCallback(Handler.java:605)
01-25 11:16:59.179: E/AndroidRuntime(1151): 	at android.os.Handler.dispatchMessage(Handler.java:92)
01-25 11:16:59.179: E/AndroidRuntime(1151): 	at android.os.Looper.loop(Looper.java:137)
01-25 11:16:59.179: E/AndroidRuntime(1151): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
01-25 11:16:59.179: E/AndroidRuntime(1151): 	at java.lang.reflect.Method.invokeNative(Native Method)
01-25 11:16:59.179: E/AndroidRuntime(1151): 	at java.lang.reflect.Method.invoke(Method.java:511)
01-25 11:16:59.179: E/AndroidRuntime(1151): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-25 11:16:59.179: E/AndroidRuntime(1151): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-25 11:16:59.179: E/AndroidRuntime(1151): 	at dalvik.system.NativeStart.main(Native Method)
01-25 11:21:35.849: D/gralloc_goldfish(1201): Emulator without GPU emulation detected.
01-25 11:21:53.938: D/AndroidRuntime(1201): Shutting down VM
01-25 11:21:53.938: W/dalvikvm(1201): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-25 11:21:53.958: E/AndroidRuntime(1201): FATAL EXCEPTION: main
01-25 11:21:53.958: E/AndroidRuntime(1201): java.lang.NullPointerException
01-25 11:21:53.958: E/AndroidRuntime(1201): 	at de.taschenrechner.steffen.TaschenrechnerActivity.onClick(TaschenrechnerActivity.java:35)
01-25 11:21:53.958: E/AndroidRuntime(1201): 	at android.view.View.performClick(View.java:3511)
01-25 11:21:53.958: E/AndroidRuntime(1201): 	at android.view.View$PerformClick.run(View.java:14105)
01-25 11:21:53.958: E/AndroidRuntime(1201): 	at android.os.Handler.handleCallback(Handler.java:605)
01-25 11:21:53.958: E/AndroidRuntime(1201): 	at android.os.Handler.dispatchMessage(Handler.java:92)
01-25 11:21:53.958: E/AndroidRuntime(1201): 	at android.os.Looper.loop(Looper.java:137)
01-25 11:21:53.958: E/AndroidRuntime(1201): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
01-25 11:21:53.958: E/AndroidRuntime(1201): 	at java.lang.reflect.Method.invokeNative(Native Method)
01-25 11:21:53.958: E/AndroidRuntime(1201): 	at java.lang.reflect.Method.invoke(Method.java:511)
01-25 11:21:53.958: E/AndroidRuntime(1201): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-25 11:21:53.958: E/AndroidRuntime(1201): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-25 11:21:53.958: E/AndroidRuntime(1201): 	at dalvik.system.NativeStart.main(Native Method)
```


----------



## Plopo (25. Jan 2012)

Siehst du, da haben wir schon das Problem.

```
zahl1 = (TextView) findViewById(R.id.ezahl1);
        zahl1 = (TextView) findViewById(R.id.ezahl2);
```

Zweimal wird die Variable "zahl1" beschrieben


----------



## Pixel1337 (25. Jan 2012)

Ohje.... Danke(!!) das war der Fehler.

Sag mal, hast du das aus dem Log gesehen oder ist dir das bei dem Quelltext aufgefallen?


----------



## Plopo (25. Jan 2012)

Beides.
Im Log steht da folgendes

```
at de.taschenrechner.steffen.TaschenrechnerActivity.onClick(TaschenrechnerActivity.java:35)
```

Daran sah ich das was mit der Zeile 35 nicht stimmt.
Bei genauerem betrachten ist es mir dann aufgefallen.


----------

