I have written this code in SplashScreenActivity
in onCreate()
:
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();
}
This is the error I'm getting:
The method schedule(TimerTask, Date) in the type Timer is not applicable for the arguments (SplashScreenActivity, int)