-
Notifications
You must be signed in to change notification settings - Fork 0
/
Splash.java
35 lines (26 loc) · 918 Bytes
/
Splash.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package net.androidbootcamp.hotfoot;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import java.util.Timer;
import java.util.TimerTask;
public class Splash extends AppCompatActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
TimerTask task = new TimerTask() {
@Override
public void run() {
finish();
//when the timer is done switch to next activity
startActivity(new Intent(Splash.this, MainActivity.class));
}
};
Timer opening = new Timer();
opening.schedule(task,3000); //set timer for 5 seconds
}
}