How to call method from another class in Android?
<p>I've been trying to call a method from another class. </p>

<p>I have 2 classes. Timer.class and DecisionMaking.class. The Timer class is suppose to call a method (I just used a toast for now) from DecisionMaking.class once the timer is onFinish(). There is no error in my codes but when the timer finish counting, the method was not called and the emulator ask to Force Close. Both of the classes are in the same package. Is there anything that I'm missing?</p>

<p><strong>Timer.class</strong></p>

<pre><code>public class Timer extends Activity{

  TextView timeDisplay;
  MyCount timer;
  int length = 10000;
  long startTime;
  long timeRemaining;
  DecisionMaking decisionmaking;


  /** Called when the activity is first created. */

  public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.main);

     timeDisplay = (TextView) findViewById(R.id.timer);
     timer = new MyCount(length, 1000);

     timer.start();

 } 

public class MyCount extends CountDownTimer {

public MyCount(long millisInFuture, long countDownInterval) {
           super(millisInFuture, countDownInterval);
    }

    public void onFinish() {

      DecisionMaking decisionmaking = new DecisionMaking(); 
      decisionmaking.sendSms();

     timer.start();
    }

    public void onTick(long millisUntilFinished) {
       timeDisplay.setText("Time:" + millisUntilFinished / 1000);
    }
  }
</code></pre>

<p>}</p>

<p><strong>DecisionMaking.class</strong></p>

<pre><code>public class DecisionMaking extends Timer{  

 public void onCreate(Bundle savedInstanceState) {        
    super.onCreate(savedInstanceState);  

    sendSms();
    }

    public boolean sendSms() {

     Calendar cal = Calendar.getInstance();
         Date d = cal.getTime();
         int hour = d.getHours();

     if (hour &gt; 0 &amp;&amp; hour &lt; 6)
        return false;
     else
        {
        //Call SMS class here, remove toast
        Toast.makeText(getBaseContext(), "SMS sent.", Toast.LENGTH_SHORT).show();

        return true;
     }
 }
}
</code></pre>
