Two players game scoring sheet
<p>Hello guys i am new in adroid development and not so keen with java just starting to learn the basics and hopefully i will become better soon.So i am trying to create a score sheet with two teams and two add buttons each of one opens a dialog to add the values(3) and then have the score showed on the screen and at the end display the points all together. If anyone can help me it would be great.</p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_papers);
    /*
     * TextView for the name of teams passed from Calculator class where
     * name1 and name2 are the id of string put into name editext at
     * Calculator and passed here using the intent we used before
     */

    team1name = (TextView) findViewById(R.id.name1);
    team2name = (TextView) findViewById(R.id.name2);
    pointsget = (TextView) findViewById(R.id.pointsget);
    team1name.setText(getIntent().getExtras().getString("name1"));
    team2name.setText(getIntent().getExtras().getString("name2"));
    pointsget.setText(getIntent().getExtras().getString("points"));

    /*
     * add1 and add2 are the buttons used for the dialog to pop up and input
     * the values of our cards
     */
    add1 = (Button) findViewById(R.id.add1);
    add2 = (Button) findViewById(R.id.add2);
    /*
     * counter1 and 2 are the integers used for the score values to be added
     * on
     */
    counter1 = 0;
    counter2 = 0;

    /* score1 and score2 are the textviews where the score will be displayed */
    score1 = (TextView) findViewById(R.id.score1);
    score2 = (TextView) findViewById(R.id.score2);

    final Context context = this;

    /*
     * all the lines that we use in order to input the values from the
     * dialog
     */
    add1.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {

            LayoutInflater addingdialog = LayoutInflater.from(context);
            final View dialogaddteam1 = addingdialog.inflate(
                    R.layout.activity_adding, null);

            final TextView mpirimpes1 = (EditText) dialogaddteam1
                    .findViewById(R.id.mpiria);
            final TextView xartia1 = (EditText) dialogaddteam1
                    .findViewById(R.id.mpirib);
            final TextView xartiaonhand1 = (EditText) dialogaddteam1
                    .findViewById(R.id.xartiaon1);

            AlertDialog.Builder adding = new AlertDialog.Builder(context);
            adding.setTitle("Team 1");

            adding.setView(dialogaddteam1).setPositiveButton("OK",
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog,
                                int whichButton) {

                            String line1a = mpirimpes1.getText().toString();
                            String line1b = xartia1.getText().toString();
                            String line1c = xartiaonhand1.getText()
                                    .toString();
                            final int mpirimpes1number = Integer
                                    .parseInt(line1a);
                            final int xartia1number = Integer
                                    .parseInt(line1b);
                            int xartiaonhand1number = Integer
                                    .parseInt(line1c);
                            counteronly = counteronly + mpirimpes1number
                                    + xartia1number - xartiaonhand1number;

                            counter1 = counter1 + counteronly;
                            score1.setText("Score=" + counter1);
                        }
                    });
            AlertDialog open = adding.create();
            open.show();
        }
    });

}
</code></pre>

<p>}</p>
