Java tutorial
//package com.java2s; import android.app.Dialog; public class Main { private static Dialog mDialog; public static void removeCustomeProgressDialog() { try { if (mDialog != null) { if (mDialog.isShowing()) { mDialog.dismiss(); mDialog = null; } } } catch (IllegalArgumentException ie) { ie.printStackTrace(); } catch (RuntimeException re) { re.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } }