Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //MainActivity.java
- public class MainActivity extends AppCompatActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- final Intent intent = new Intent(this, Login.class);
- Timer t = new Timer();
- TimerTask tt = new TimerTask() {
- @Override
- public void run() {
- startActivity(intent);
- }
- };
- t.schedule(tt, 5000);
- }
- }
- //Login.java
- public class Login extends AppCompatActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_login);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement