Show message if internet is off as the splash screen loads
<p>I have written this code in <code>SplashScreenActivity</code> in <code>onCreate()</code>:</p>

<pre><code>Timer t = new Timer();
    boolean checkConnection=new MainActivity().checkConnection(this);
    if (checkConnection) {
      t.schedule(new SplashScreenActivity(), 3000);

    } else {
        Toast.makeText(SplashScreenActivity.this,
                "connection not found...plz check connection", 3000).show();
    }
</code></pre>

<p>This is the error I'm getting:</p>

<blockquote>
  <p>The method schedule(TimerTask, Date) in the type Timer is not
  applicable for the arguments (SplashScreenActivity, int)</p>
</blockquote>