Commit e92abe6b authored by Ari Trachtenberg's avatar Ari Trachtenberg
Browse files

Merge branch '6-repeated-event' into 'master'

Resolve "Repeated event"

Closes #6

See merge request ec327_projects/group7project!12
parents 1eab4c3f a0671bcf
Loading
Loading
Loading
Loading

MainActivity.java

0 → 100644
+31 −0
Original line number Diff line number Diff line
package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.Toast;

import java.util.Timer;
import java.util.TimerTask;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(getApplicationContext(), "I brought the wrong toast to the wedding, at least the ducks enjoyed it", Toast.LENGTH_SHORT).show();
                    }
                });
            }
        }, 0, 7500); //makes it so that it takes 5 seconds after each message disappears to show the next one.
    }
}
 No newline at end of file