title: Android Error: Undefined Method
body: <p>I've got a Fragment (ActionBarSherlock Tabs), and I want to run a Chronometer in Background:</p>
  
  <pre><code>public class BFragment extends SherlockFragment {
  
  private Button start;
  private View v;
  private Chronometer chrono;
  private Button pause;
  private Button reset;
  private long lastPause;
  private Button resume;
  private boolean isChronometerRunning = false;
  private boolean richtig = false;
  
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
      // Inflate the layout for this fragment
  
      v = inflater.inflate(R.layout.activity_bfragment, container, false);
      start = (Button) v.findViewById(R.id.start); 
      chrono = (Chronometer) v.findViewById(R.id.chronometer1);
      pause = (Button) v.findViewById(R.id.pause);
      reset = (Button) v.findViewById(R.id.reset);
      resume = (Button) v.findViewById(R.id.resume);
  
  
      new ChronoBackground().execute();
  
  
      return v;
  
  }
  
  void StartTimer() {
      start.setOnClickListener(new View.OnClickListener() {
          public void onClick(View view) {
  
              chrono.setBase(SystemClock.elapsedRealtime());
              chrono.start();
              isChronometerRunning = true;
              System.out.println(SystemClock.elapsedRealtime());
  
          }
      });
  
      pause.setOnClickListener(new View.OnClickListener() {
          public void onClick(View view) {
  
              lastPause = SystemClock.elapsedRealtime();
              chrono.stop();
              isChronometerRunning = false;
              richtig = true;
  
          }
      });
  
      resume.setOnClickListener(new View.OnClickListener() {
          public void onClick(View view) {
              if (isChronometerRunning == false &amp;&amp; richtig) {
                  chrono.setBase(chrono.getBase() + SystemClock.elapsedRealtime() - lastPause);
                  chrono.start();
                  richtig = false;
              } else {
  
              }
          }
      });
  
      reset.setOnClickListener(new View.OnClickListener() {
          public void onClick(View view) {
  
              chrono.setBase(SystemClock.elapsedRealtime());
              System.out.println(chrono.getBase());
  
          }
      });
  }
  }
  </code></pre>
  
  <p>And here is my ChronBackground class/code:</p>
  
  <pre><code>public class ChronoBackground extends AsyncTask&lt;Void, Void, Void&gt; {
  
  /** The system calls this to perform work in a worker thread and
    * delivers it the parameters given to AsyncTask.execute() */
  
  @Override
  protected Void doInBackground(Void... arg0) {
      // TODO Auto-generated method stub
      StartTimer();
      return null;
  }
  
  /** The system calls this to perform work in the UI thread and delivers
    * the result from doInBackground() */
  @Override
  protected void onPostExecute(Void result) {
  
      return ;
  }
  
  @Override
  protected void onPreExecute() {
  
          return ;
  }
  }
  </code></pre>
  
  <p>Now there's an error, and I'm not really sure if my chrono is working this way... The error is at ChronoBackground: StartTimer() not defined.</p>