[Java for Android App Development] Paulius7:
Hello again, now my program crash(Force Close) when I press one of buttons.

updated code

package com.leftas.vidurkioskaiciavimas;

import android.content.Intent;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;

public class vidurkioskaiciuokle extends Activity {
int c;
TextView mUserOutput,mUserInput;

[MENTION=439709]override[/MENTION]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.vidurkio_skaiciuokle);

TextView mUserOutput = (TextView) findViewById(R.id.textView2);
TextView mUserInput = (TextView) findViewById(R.id.textView);

}
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.vidurkioskaiciuokle, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.about:
startActivity(new Intent(this, About.class));
return true;
case R.id.exit:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
}

private void buttonEventHandler(View v) {
switch(v.getId()) {

case R.id.button1 :
mUserInput.setText(mUserInput.getText() + "1");
c = +1;
break;

case R.id.button2 :
mUserInput.setText(mUserInput.getText() + "2");
c = +2;
break;

case R.id.button3 :
mUserInput.setText(mUserInput.getText() + "3");
c = +3;
break;

case R.id.button4 :
mUserInput.setText(mUserInput.getText() + "4");
c = +4;
break;

case R.id.button5 :
mUserInput.setText(mUserInput.getText() + "5");
c = +5;
break;

case R.id.button6 :
mUserInput.setText(mUserInput.getText() + "6");
c = +6;
break;

case R.id.button7 :
mUserInput.setText(mUserInput.getText() + "7");
c = +7;
break;

case R.id.button8 :
mUserInput.setText(mUserInput.getText() + "8");
c = +8;
break;

case R.id.button9 :
mUserInput.setText(mUserInput.getText() + "9");
c = +9;
break;

case R.id.button10 :
mUserInput.setText(mUserInput.getText() + "10");
c = +10;
break;

case R.id.buttonclear :
mUserOutput.setText(null);
mUserInput.setText(null);
c = 0;
double average = 0;
}
}

public void computeAverage(int [] scores)
{
double average = 0;
for (int c : scores) {
average += c;
}

average /= scores.length;

mUserOutput.setText(Double.toString(average));
}

}

Xml File

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".vidurkioskaiciuokle">

<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1"
android:id="@+id/button1"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:onClick="buttonEventHandler" />

<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2"
android:id="@+id/button2"
android:layout_alignTop="@+id/button1"
android:layout_toRightOf="@+id/button1"
android:onClick="buttonEventHandler" />

<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3"
android:id="@+id/button3"
android:layout_alignBottom="@+id/button2"
android:layout_toRightOf="@+id/button2"
android:onClick="buttonEventHandler" />

<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="4"
android:id="@+id/button4"
android:layout_alignTop="@+id/button3"
android:layout_toRightOf="@+id/button3"
android:onClick="buttonEventHandler" />

<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="5"
android:id="@+id/button5"
android:layout_alignTop="@+id/button4"
android:layout_toRightOf="@+id/button4"
android:onClick="buttonEventHandler" />

<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="6"
android:id="@+id/button6"
android:layout_alignTop="@+id/button5"
android:layout_toRightOf="@+id/button5"
android:onClick="buttonEventHandler" />

<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="7"
android:id="@+id/button7"
android:layout_above="@+id/button2"
android:layout_toRightOf="@+id/button2"
android:onClick="buttonEventHandler" />

<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="8"
android:id="@+id/button8"
android:layout_alignTop="@+id/button9"
android:layout_toLeftOf="@+id/button9"
android:onClick="buttonEventHandler" />

<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="9"
android:id="@+id/button9"
android:layout_above="@+id/button2"
android:layout_toLeftOf="@+id/button3"
android:onClick="buttonEventHandler" />

<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="10"
android:id="@+id/button10"
android:layout_above="@+id/button4"
android:layout_toLeftOf="@+id/button5"
android:onClick="buttonEventHandler" />

<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/textView"
android:layout_above="@+id/textView2"
android:layout_alignParentRight="true" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView2"
android:layout_alignParentStart="false"
android:layout_alignParentEnd="false"
android:layout_alignWithParentIfMissing="false"
android:layout_above="@+id/button8"
android:layout_alignLeft="@+id/button8"
android:layout_alignRight="@+id/textView" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Clear"
android:id="@+id/buttonclear"
android:layout_above="@+id/button5"
android:layout_alignRight="@+id/button6"
android:layout_alignLeft="@+id/button5"
android:onClick="buttonEventHandler" />

</RelativeLayout>