List of usage examples for android.view ViewTreeObserver removeOnGlobalFocusChangeListener
public void removeOnGlobalFocusChangeListener(OnGlobalFocusChangeListener victim)
From source file:eu.inmite.android.lib.validations.form.FormValidator.java
/** * stop previously started live validation by {@link #startLiveValidation(Object, android.view.View, eu.inmite.android.lib.validations.form.iface.IValidationCallback)} * @param target live validation is recognized by target object * @return true if there was live validation to stop *//*from w w w . j av a 2 s . co m*/ public static boolean stopLiveValidation(final Object target) { if (sLiveValidations == null || !sLiveValidations.containsKey(target)) { return false; } final ViewGlobalFocusChangeListener removed = sLiveValidations.remove(target); final ViewTreeObserver treeObserver = removed.formContainer.getViewTreeObserver(); if (treeObserver.isAlive()) { treeObserver.removeOnGlobalFocusChangeListener(removed); return true; } return false; }