i am getting error.
Activity com.act.hyd.app.EmtyActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@416e8bb8 that was originally added here
in a splash screen I will check version code of app. If it is not suitable version then show an AlertDialog. But I am getting the above error.how to solve it.
public void incorrectMessages(){
           AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
                    context);
                // set title
                alertDialogBuilder.setTitle("Your Title");
                // set dialog message
                alertDialogBuilder
                    .setMessage("Click yes to exit!")
                    .setCancelable(false)
                    .setPositiveButton("Yes",new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog,int id) {
                            // if this button is clicked, close
                            // current activity
                            Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
                            startActivity(browserIntent);
                        }
                      })
                    .setNegativeButton("No",new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog,int id) {
                            // if this button is clicked, just close
                            // the dialog box and do nothing
                            dialog.dismiss();
                        }
                    });
                    // create alert dialog
                    AlertDialog alertDialog = alertDialogBuilder.create();
                    // show it
                    alertDialog.show();
                 Toast.makeText(getApplicationContext(), "Dear ACT Customer your App looks old version .Please upgrade from Playstore ", Toast.LENGTH_LONG).show();
                 onRestart();
             }