Commit 30a97a8e authored by Jilin Zheng's avatar Jilin Zheng
Browse files

Delete MainActivity.java

parent 4b62d4d8
Loading
Loading
Loading
Loading
+0 −37
Original line number Diff line number Diff line
package com.example.toast;

import androidx.appcompat.app.AppCompatActivity;

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

public class MainActivity extends AppCompatActivity {
    String[] toasts = {"Wanna hear a joke?", "It's quiz time! Let's meet at PHO.", "You guys look tired, let's take a break."};

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

    }

    @Override
    protected void onStart() {
        super.onStart();

        int ii = 0;
        while (true) {
            try {
                Thread.sleep(5000);
                Toast.makeText(this,toasts[ii],Toast.LENGTH_SHORT).show();
                if (ii<2) {
                    ii++;
                } else {
                    ii = 0;
                }
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
 No newline at end of file