How can I make my one pop up window appear at regular intervals
<p>I have created a popup which appear only once, when a button is clicked. However, I need it to appear repeatedly randomly again and again while having to press the button only once. Please see the code below:</p>

<p>Method to create the pop up window</p>

<pre><code>    public void onWindowFocusChanged(boolean hasFocus) {

   p2 = new Point(700, 40);

}



//method that displays the pop up
private void showPopup(final CreateQuestions createQuestions1, Point p2) {
    // TODO Auto-generated method stub
    int popupWidth = 330;
    int popupHeight = 200;

    LinearLayout viewGroup = (LinearLayout) createQuestions1.findViewById (R.id.popupLayout);
    LayoutInflater layoutInflater  = (LayoutInflater) createQuestions1.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View layout = layoutInflater.inflate(R.layout.popup, viewGroup);
    TextView databaseQuestions = (TextView)findViewById(R.id.popupContent);
    //method to create the popup
    final PopupWindow popupWindow = new PopupWindow(createQuestions1);
    popupWindow.setContentView(layout);
    popupWindow.setWidth(popupWidth);
    popupWindow.setHeight(popupHeight);



    //some offsets to align the pop up 
    int OFFSET_X = 170;
    int OFFSET_Y = 100;

    //clear the default background
    popupWindow.setBackgroundDrawable(new BitmapDrawable());

    //displaying the pop up at the specified location and offsets
    popupWindow.showAtLocation(layout, Gravity.NO_GRAVITY, p2.x + OFFSET_X, p2.y + OFFSET_Y);

    //getting the reference to Close button and close the popup when clicked.
    close = (Button) layout.findViewById(R.id.popUpButtonClose);
    close.setOnClickListener(new OnClickListener(){

        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            popupWindow.dismiss();
        }


    });

    }
</code></pre>

<p>Code of the button which enables the pop up window</p>

<pre><code>    case R.id.buttonStartQuiz:

            Log.d(TAG, "showPopup'd" + p2);

            if (p2 != null)
            {
                showPopup(CreateQuestions.this, p2);

            }
</code></pre>

<p>your help &amp; guidance and tips would be really helpful.</p>
