title: Android RunTime Error Eclipse
body: <p>I've been learning some java for android by reading and trying codes, and whenever I start the application on android it crashes. In the LogCat, this shows:</p>
  
  <p>08-09 16:13:24.033: E/AndroidRuntime(839):  ... 11 more</p>
  
  <p>Here is my activity_main.xml:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"&gt;
    &lt;LinearLayout
      android:orientation="horizontal"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:padding="10dip"&gt;
      &lt;TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="20sp"
        android:text="Brews: " /&gt;
      &lt;TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="None"
        android:gravity="end"
        android:textSize="20sp"
        android:id="@+id/brew_count_label" /&gt;
    &lt;/LinearLayout&gt;
    &lt;LinearLayout
      android:orientation="horizontal"
      android:layout_width="fill_parent"
      android:layout_height="0dp"
      android:layout_weight="1"
      android:gravity="center"
      android:padding="10dip"&gt;
      &lt;Button
        android:id="@+id/brew_time_down"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="-"
        android:textSize="40sp" /&gt;
      &lt;TextView
        android:id="@+id/brew_time"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="0:00"
        android:textSize="40sp"
        android:padding="10dip" /&gt;
      &lt;Button
        android:id="@+id/brew_time_up"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="+"
        android:textSize="40sp" /&gt;
    &lt;/LinearLayout&gt;
    &lt;Button
      android:id="@+id/brew_start"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_gravity="bottom"
      android:text="Start" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>And here is my MainActivity.java:</p>
  
  <pre><code>package com.example.basketball;
  
  import android.support.v7.app.ActionBarActivity;
  import android.os.Bundle;
  import android.os.CountDownTimer;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.TextView;
  
  public class MainActivity extends ActionBarActivity implements OnClickListener {
        /** Properties **/
        protected Button brewAddTime;
        protected Button brewDecreaseTime;
        protected Button startBrew;
        protected TextView brewCountLabel;
        protected TextView brewTimeLabel;
  
        protected int brewTime = 3;
        protected CountDownTimer brewCountDownTimer;
        protected int brewCount = 0;
        protected boolean isBrewing = false;
  
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          //setContentView(R.layout.main);
  
          // Connect interface elements to properties
          brewAddTime = (Button) findViewById(R.id.brew_time_up);
          brewDecreaseTime = (Button) findViewById(R.id.brew_time_down);
          startBrew = (Button) findViewById(R.id.brew_start);
          brewCountLabel = (TextView) findViewById(R.id.brew_count_label);
          brewTimeLabel = (TextView) findViewById(R.id.brew_time);
  
          // Setup ClickListeners
          brewAddTime.setOnClickListener(this);
          brewDecreaseTime.setOnClickListener(this);
          startBrew.setOnClickListener(this);
  
          // Set the initial brew values
          setBrewCount(0);
          setBrewTime(3);
        }
  
        /** Methods **/
  
        /**
         * Set an absolute value for the number of minutes to brew. Has no effect if a brew
         * is currently running.
         * @param minutes The number of minutes to brew.
         */
        public void setBrewTime(int minutes) {
          if(isBrewing)
            return;
  
          brewTime = minutes;
  
          if(brewTime &lt; 1)
            brewTime = 1;
  
          brewTimeLabel.setText(String.valueOf(brewTime) + "m");
        }
  
        /**
         * Set the number of brews that have been made, and update the interface. 
         * @param count The new number of brews
         */
        public void setBrewCount(int count) {
          brewCount = count;
          brewCountLabel.setText(String.valueOf(brewCount));
        }
  
        /**
         * Start the brew timer
         */
        public void startBrew() {
          // Create a new CountDownTimer to track the brew time
          brewCountDownTimer = new CountDownTimer(brewTime * 60 * 1000, 1000) {
            @Override
            public void onTick(long millisUntilFinished) {
              brewTimeLabel.setText(String.valueOf(millisUntilFinished / 1000) + "s");
            }
  
            @Override
            public void onFinish() {
              isBrewing = false;
              setBrewCount(brewCount + 1);
  
              brewTimeLabel.setText("Brew Up!");
              startBrew.setText("Start");
            }
          };
  
          brewCountDownTimer.start();
          startBrew.setText("Stop");
          isBrewing = true;
        }
  
        /**
         * Stop the brew timer
         */
        public void stopBrew() {
          if(brewCountDownTimer != null)
            brewCountDownTimer.cancel();
  
          isBrewing = false;
          startBrew.setText("Start");
        }
  
        /** Interface Implementations **/
        /* (non-Javadoc)
         * @see android.view.View.OnClickListener#onClick(android.view.View)
         */
        public void onClick(View v) {
          if(v == brewAddTime)
            setBrewTime(brewTime + 1);
          else if(v == brewDecreaseTime)
            setBrewTime(brewTime -1);
          else if(v == startBrew) {
            if(isBrewing)
              stopBrew();
            else
              startBrew();
          }
        }
      }
  </code></pre>
  
  <p>Anyone knows how to fix this error?
  Please help.</p>