Code example for View

Methods: getLocationOnScreen

0
						private int keyboardHeight;
						private boolean keyboardShowing;
 
						@Override 
						public boolean onPreDraw () { 
							content.getLocationOnScreen(screenloc);
							keyboardHeight = Math.abs(screenloc[1]);
							if (keyboardHeight > 0) keyboardShowing = true;
							if (keyboardHeight == 0 && keyboardShowing) {
								dialog.dismiss();
								dialog = null;
							} 
							return true; 
						} 
					}); 
				} 
			}); 
		} else { 
			if (!visible && dialog != null) {
				dialog.dismiss();
			}