Basic Android Eclipse Development Errors
<p>(Solved) Thanks to NetCat: it was a UI XML problem :)</p>

<p>Today I have started Android development, i'm using a Mac with Eclipse and the Android SDK install and all working (I have successfully managed to get working a few "Hello World" type apps working) and for the Android device i'm using my new HTC Incredible S.</p>

<p>So the code below should work and their are no error is the debugger when I run it on my phone, but each time I do before it even loads, the phone pops up a message saying "The application Count (process com.count) has stopped unexpectedly. Please try agin."</p>

<p>I have re created the project several times with different SDK versions 1.5 and 2.2 but still no luck.</p>

<p>The code is from another tutorial I successfully worked through but i have changed some of the variables to make a slightly different app. Can you tell me what is wrong with the following code:</p>

<pre><code>package com.count;

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

public class count extends Activity implements OnClickListener {


//Declare widgets
Button btnSave, btnUp, btnDown;
TextView lblCurrentCount, lblCountCard;

//Declare variables
int intCount=0;
int intCardCount=0;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    //Sets up the link between java and the XML widgets
    btnSave = (Button)findViewById(R.id.btnSave);
    btnUp = (Button)findViewById(R.id.btnUp);
    btnDown = (Button)findViewById(R.id.btnDown);
    lblCurrentCount = (TextView)findViewById(R.id.lblCurrentCount);
    lblCountCard = (TextView)findViewById(R.id.lblCountCard);

    //Initialize widgets
    lblCurrentCount.setText(String.valueOf(intCount));
    lblCountCard.setText("");

    //Define button listeners
    btnSave.setOnClickListener(this);
    btnUp.setOnClickListener(this);
    btnDown.setOnClickListener(this);

}

//When any button is clicked
@Override
public void onClick(View src) {

    //Actions when buttons are clicked
    switch(src.getId()) {
    case R.id.btnSave:
        lblCountCard.append("\n#" + intCardCount + " " + intCount);
        intCardCount++;
        intCount=0;
        lblCountCard.setText(String.valueOf(intCount));
        break;
    case R.id.btnUp:
        intCount++;
        lblCountCard.setText(String.valueOf(intCount));
        break;
    case R.id.btnDown:
        intCount--;
        lblCountCard.setText(String.valueOf(intCount));
        break;
    }

}
}
</code></pre>

<p>Thanks Dave</p>
