restarting CountDownTimer from another activity
<p>i have this code to create a CountdownTimer:</p>

<pre><code> CountDownTimer CountdownTimer = new CountDownTimer(30000, 1000) {
 public void onTick(long millisUntilFinished) {
     txttime.setText(millisUntilFinished / 1000 );
 }

 public void onFinish(){
     timeout_stage();
 }
</code></pre>

<p>}.start();</p>

<p>it works fine and i can cancel and start it perfectly, but i want to restart it from another activity. in main form i cancell it, the an activity opens like a dialogbox that has a "AGAIN" button. when i click on that, i want to  CountDownTimer.start(); called and my counter restarts again...</p>

<p>how i can do this?</p>

<p>i do this in second activity:</p>

<pre><code>MainActivity main = new MainActivity();
main.CountdownTimer.start();
</code></pre>

<p>but i get this error:</p>

<pre><code>04-28 11:42:40.495: E/AndroidRuntime(17039): FATAL EXCEPTION: main
04-28 11:42:40.495: E/AndroidRuntime(17039): java.lang.NullPointerException
04-28 11:42:40.495: E/AndroidRuntime(17039):    at com.english.game.MainActivity$1.onTick(MainActivity.java:70)
04-28 11:42:40.495: E/AndroidRuntime(17039):    at android.os.CountDownTimer$1.handleMessage(CountDownTimer.java:124)
04-28 11:42:40.495: E/AndroidRuntime(17039):    at android.os.Handler.dispatchMessage(Handler.java:99)
04-28 11:42:40.495: E/AndroidRuntime(17039):    at android.os.Looper.loop(Looper.java:137)
04-28 11:42:40.495: E/AndroidRuntime(17039):    at android.app.ActivityThread.main(ActivityThread.java:5041)
04-28 11:42:40.495: E/AndroidRuntime(17039):    at java.lang.reflect.Method.invokeNative(Native Method)
04-28 11:42:40.495: E/AndroidRuntime(17039):    at java.lang.reflect.Method.invoke(Method.java:511)
04-28 11:42:40.495: E/AndroidRuntime(17039):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
04-28 11:42:40.495: E/AndroidRuntime(17039):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
04-28 11:42:40.495: E/AndroidRuntime(17039):    at dalvik.system.NativeStart.main(Native Method)
</code></pre>
