Guten Abend!
nachdem dieser Thread das Stichwort zu meinem Problem bildet, hoffe ich dass es Recht ist, wenn ich meine Frage zum Thema Taschenrechner gleich anfüge zumal das Problem des Kollegen anscheinend soweit geklärt ist.
Also ich versuche meine ersten Gehversuche unter Anderem auch an einer Taschenrechner-App.
Leider zeigt das Handy beim Starten nur kurz einen weißen Screen und beendet die App sofort darauf wieder.
Ich hab angeblich irgendwo eine NullPointerException laut LogCat.
Weiß aber nicht wo der Fehler liegt. Ich hab den Quelltext sowie die Log-Datei mal angehängt.
Vielen Dank im Voraus!
Gruß Christian
Code:
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]package[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#7f0055]
[LEFT][/COLOR][/SIZE][SIZE=2]com.example.taschenrechner;[/SIZE][/LEFT]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import[/COLOR][/SIZE][/COLOR][/SIZE][/B][/LEFT]
[SIZE=2][COLOR=#7f0055]
[LEFT][/COLOR][/SIZE][SIZE=2]android.app.Activity;[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import[/COLOR][/SIZE][/COLOR][/SIZE][/B][/LEFT]
[SIZE=2][COLOR=#7f0055]
[LEFT][/COLOR][/SIZE][SIZE=2]android.os.Bundle;[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import[/COLOR][/SIZE][/COLOR][/SIZE][/B][/LEFT]
[SIZE=2][COLOR=#7f0055]
[LEFT][/COLOR][/SIZE][SIZE=2]android.view.Menu;[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import[/COLOR][/SIZE][/COLOR][/SIZE][/B][/LEFT]
[SIZE=2][COLOR=#7f0055]
[LEFT][/COLOR][/SIZE][SIZE=2]android.view.View;[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import[/COLOR][/SIZE][/COLOR][/SIZE][/B][/LEFT]
[SIZE=2][COLOR=#7f0055]
[LEFT][/COLOR][/SIZE][SIZE=2]android.view.View.OnClickListener;[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import[/COLOR][/SIZE][/COLOR][/SIZE][/B][/LEFT]
[SIZE=2][COLOR=#7f0055]
[LEFT][/COLOR][/SIZE][SIZE=2]android.widget.Button;[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import[/COLOR][/SIZE][/COLOR][/SIZE][/B][/LEFT]
[SIZE=2][COLOR=#7f0055]
[LEFT][/COLOR][/SIZE][SIZE=2]android.widget.EditText;[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]import[/COLOR][/SIZE][/COLOR][/SIZE][/B][/LEFT]
[SIZE=2][COLOR=#7f0055]
[LEFT][/COLOR][/SIZE][SIZE=2]android.widget.TextView;[/SIZE][/LEFT]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public[/COLOR][/SIZE][/COLOR][/SIZE][/B][/LEFT]
[SIZE=2][COLOR=#7f0055]
[LEFT][/COLOR][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]class[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] MainActivity [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]extends[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] Activity [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]implements[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] OnClickListener{[/SIZE][/LEFT]
[LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Definition [U]der[/U] [U]Objekte[/U] [U]und[/U] [U]Variablen[/U][/COLOR][/SIZE][/COLOR][/SIZE]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] EditText [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]etWert1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] EditText [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]etWert2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] Button [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bPlus[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] Button [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bMinus[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] Button [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bMal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] Button [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bGeteilt[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] TextView [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]tvGleichung[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] Button [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bBerechnen[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = 0;[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = 0;[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] String [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sGleichung[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]""[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]float[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]fErgebnis[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = 0;[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]private[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] String [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sRechenzeichen[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]""[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE][/LEFT]
[/LEFT]
[LEFT][SIZE=2][COLOR=#646464][SIZE=2][COLOR=#646464]@Override[/COLOR][/SIZE][/COLOR][/SIZE]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]protected[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] onCreate(Bundle savedInstanceState) {[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]super[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2].onCreate(savedInstanceState);[/SIZE]
[SIZE=2]setContentView(R.layout.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]activity_main[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE][/LEFT]
[/LEFT]
[LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// [U]Verknüpfen[/U] [U]der[/U] [U]Objekte[/U] [U]mit[/U] den Views[/COLOR][/SIZE][/COLOR][/SIZE]
[LEFT][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]etWert1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = (EditText)findViewById(R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]etWert1[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]etWert2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = (EditText)findViewById(R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]etWert2[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bPlus[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = (Button)findViewById(R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bPlus[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bMinus[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = (Button)findViewById(R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bMinus[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bMal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = (Button)findViewById(R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bGeteilt[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]tvGleichung[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = (TextView)findViewById(R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]tvGleichung[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bBerechnen[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = (Button)findViewById(R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bBerechnen[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE][/LEFT]
[/LEFT]
[LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// [U]Zuordnen[/U] [U]von[/U] OnClickListenern [U]zu[/U] den Buttons[/COLOR][/SIZE][/COLOR][/SIZE]
[LEFT][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bPlus[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setOnClickListener([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]);[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bMinus[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setOnClickListener([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]);[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bMal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setOnClickListener([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]);[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bGeteilt[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setOnClickListener([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]);[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bBerechnen[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setOnClickListener([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]this[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]);[/SIZE]
[SIZE=2]}[/SIZE][/LEFT]
[/LEFT]
[LEFT][SIZE=2][COLOR=#646464][SIZE=2][COLOR=#646464]@Override[/COLOR][/SIZE][/COLOR][/SIZE]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]boolean[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] onCreateOptionsMenu(Menu menu) {[/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Inflate the menu; this adds items to the action bar if it is present.[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2]getMenuInflater().inflate(R.menu.[/SIZE][/LEFT]
[/LEFT]
[LEFT][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]main[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2], menu);[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]return[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]true[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2];[/SIZE]
[LEFT][SIZE=2]}[/SIZE][/LEFT]
[/LEFT]
[LEFT][SIZE=2][COLOR=#646464][SIZE=2][COLOR=#646464]@Override[/COLOR][/SIZE][/COLOR][/SIZE]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] onClick(View v) {[/SIZE][/LEFT]
[/LEFT]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ([/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]etWert1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText().toString().equals([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]""[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]) || [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]etWert2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText().toString().equals([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]""[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]))[/SIZE]
[LEFT][SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = Integer.[I]valueOf[/I]([/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]etWert1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText().toString());[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = Integer.[I]valueOf[/I]([/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]etWert2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText().toString());[/SIZE][/LEFT]
[/LEFT]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (v.getId()==R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bPlus[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2])[/SIZE]
[LEFT][SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sRechenzeichen[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]" + "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]}[/SIZE][/LEFT]
[/LEFT]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (v.getId()==R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bMinus[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2])[/SIZE]
[LEFT][SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sRechenzeichen[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]" - "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]}[/SIZE][/LEFT]
[/LEFT]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (v.getId()==R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bMal[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2])[/SIZE]
[LEFT][SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sRechenzeichen[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]" * "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]}[/SIZE][/LEFT]
[/LEFT]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (v.getId()==R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bGeteilt[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2])[/SIZE]
[LEFT][SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sRechenzeichen[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]" : "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]}[/SIZE][/LEFT]
[/LEFT]
[LEFT][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sGleichung[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sRechenzeichen[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]" = ?"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[LEFT][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]tvGleichung[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText([/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sGleichung[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE][/LEFT]
[/LEFT]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (v.getId()==R.id.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]bBerechnen[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2])[/SIZE]
[LEFT][SIZE=2]{[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ([/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sRechenzeichen[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] == [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]" + "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]fErgebnis[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]}[/SIZE][/LEFT]
[/LEFT]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ([/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sRechenzeichen[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] == [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]" - "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE]
[LEFT][SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]fErgebnis[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] - [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]}[/SIZE][/LEFT]
[/LEFT]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ([/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sRechenzeichen[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] == [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]" * "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE]
[LEFT][SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]fErgebnis[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] * [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]}[/SIZE][/LEFT]
[/LEFT]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ([/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sRechenzeichen[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] == [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]" : "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE]
[LEFT][SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]fErgebnis[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] / [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]}[/SIZE][/LEFT]
[/LEFT]
[LEFT][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sGleichung[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sRechenzeichen[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]iWert2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]" = "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + [/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]fErgebnis[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[LEFT][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]tvGleichung[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].setText([/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]sGleichung[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE]
[SIZE=2]}[/SIZE][/LEFT]
[/LEFT]
[LEFT][SIZE=2]}[/SIZE]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/COLOR][/SIZE][/COLOR][/SIZE][/B]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// [U]hier[/U] [U]soll[/U] [U]mal[/U] [U]ein[/U] [U]Popup[/U] [U]hin[/U], [U]dass[/U] in [U]einem[/U] [U]der[/U] [U]beiden[/U] [U]Werte[/U] [U]nichts[/U] [U]eingegeben[/U] [U]ist[/U][/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2]}[/SIZE][/LEFT]
[/LEFT]
[LEFT][SIZE=2]}[/SIZE][/LEFT]
[LEFT][SIZE=2]}[/SIZE][/LEFT]
LogCat:
05-11 23:41:05.611: E/AndroidRuntime(27111): FATAL EXCEPTION: main
05-11 23:41:05.611: E/AndroidRuntime(27111): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.taschenrechner/com.example.taschenrechner.MainActivity}: java.lang.NullPointerException
05-11 23:41:05.611: E/AndroidRuntime(27111): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
05-11 23:41:05.611: E/AndroidRuntime(27111): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
05-11 23:41:05.611: E/AndroidRuntime(27111): at android.app.ActivityThread.access$700(ActivityThread.java:140)
05-11 23:41:05.611: E/AndroidRuntime(27111): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
05-11 23:41:05.611: E/AndroidRuntime(27111): at android.os.Handler.dispatchMessage(Handler.java:99)
05-11 23:41:05.611: E/AndroidRuntime(27111): at android.os.Looper.loop(Looper.java:137)
05-11 23:41:05.611: E/AndroidRuntime(27111): at android.app.ActivityThread.main(ActivityThread.java:4921)
05-11 23:41:05.611: E/AndroidRuntime(27111): at java.lang.reflect.Method.invokeNative(Native Method)
05-11 23:41:05.611: E/AndroidRuntime(27111): at java.lang.reflect.Method.invoke(Method.java:511)
05-11 23:41:05.611: E/AndroidRuntime(27111): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
05-11 23:41:05.611: E/AndroidRuntime(27111): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
05-11 23:41:05.611: E/AndroidRuntime(27111): at dalvik.system.NativeStart.main(Native Method)
05-11 23:41:05.611: E/AndroidRuntime(27111): Caused by: java.lang.NullPointerException
05-11 23:41:05.611: E/AndroidRuntime(27111): at com.example.taschenrechner.MainActivity.onCreate(MainActivity.java:46)
05-11 23:41:05.611: E/AndroidRuntime(27111): at android.app.Activity.performCreate(Activity.java:5206)
05-11 23:41:05.611: E/AndroidRuntime(27111): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
05-11 23:41:05.611: E/AndroidRuntime(27111): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
05-11 23:41:05.611: E/AndroidRuntime(27111): ... 11 more