当前位置: 首页>>代码示例>>Java>>正文


Java Utility.stringsEqualOrEmpty方法代码示例

本文整理汇总了Java中com.facebook.internal.Utility.stringsEqualOrEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java Utility.stringsEqualOrEmpty方法的具体用法?Java Utility.stringsEqualOrEmpty怎么用?Java Utility.stringsEqualOrEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.internal.Utility的用法示例。


在下文中一共展示了Utility.stringsEqualOrEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onSearchBoxTextChanged

import com.facebook.internal.Utility; //导入方法依赖的package包/类
/**
 * Sets the search text and reloads the data in the control. This is used to provide search-box
 * functionality where the user may be typing or editing text rapidly. It uses a timer to avoid repeated
 * requerying, preferring to wait until the user pauses typing to refresh the data. Note that this
 * method will NOT update the text in the search box, if any, as it is intended to be called as a result
 * of changes to the search box (and is public to enable applications to provide their own search box
 * UI instead of the default one).
 *
 * @param searchText                 the search text
 * @param forceReloadEventIfSameText if true, will reload even if the search text has not changed; if false,
 *                                   identical search text will not force a reload
 */
public void onSearchBoxTextChanged(String searchText, boolean forceReloadEventIfSameText) {
    if (!forceReloadEventIfSameText && Utility.stringsEqualOrEmpty(this.searchText, searchText)) {
        return;
    }

    if (TextUtils.isEmpty(searchText)) {
        searchText = null;
    }
    this.searchText = searchText;

    // If search text is being set in response to user input, it is wasteful to send a new request
    // with every keystroke. Send a request the first time the search text is set, then set up a 2-second timer
    // and send whatever changes the user has made since then. (If nothing has changed
    // in 2 seconds, we reset so the next change will cause an immediate re-query.)
    hasSearchTextChangedSinceLastQuery = true;
    if (searchTextTimer == null) {
        searchTextTimer = createSearchTextTimer();
    }
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:32,代码来源:PlacePickerFragment.java


注:本文中的com.facebook.internal.Utility.stringsEqualOrEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。