Showing an Alert Dialog before opening a new activity when Button is Click
<p>I'm working on my Spinner. When I choose an item and click the SEND button, I want an alert dialog box (with OK button only) to be shown first before opening the New Activity. Seeking for help. Thanks. :')</p>

<p>This is my source code anyway. :')
MainActivity.java</p>

<pre><code>package com.example.imelda.fortesting;

import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.app.AlertDialog;
import android.content.Intent;
import android.graphics.Color;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.Toast;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;


public class MainActivity extends ActionBarActivity {
    private static Button button_send;
    private static Button button_sched;
    ImageView btn_Animate;
    Spinner spin;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        spin = (Spinner) findViewById(R.id.spinner);
        ArrayAdapter&lt;String&gt; spinnerAdapter = new ArrayAdapter&lt;String&gt;(
                this,
                android.R.layout.simple_spinner_dropdown_item,
                getResources().getStringArray(R.array.punpColleges));
        spin.setAdapter(spinnerAdapter);
        OnClickButtonListener();
        OnClickButtonSchedule();
    }


    public void OnClickButtonListener() {

        button_send = (Button) findViewById(R.id.button);
        button_send.setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        if (spin.getSelectedItem().toString().equals("CCS")) {
                            Intent intent = new Intent("com.example.imelda.mythesis.ListActivity");
                            startActivity(intent);
                        } else {
                            startActivity(new Intent("com.example.imelda.mythesis.SecondTesting"));
                        }
                    }
                }

        );
    }
</code></pre>