Java tutorial
//package com.java2s; import android.view.Window; public class Main { public static boolean isWindowValid(Window paramWindow) { return (paramWindow != null) && (paramWindow.getDecorView() != null) && (paramWindow.getDecorView().getWindowToken() != null); } }