Java Code Examples for android.widget.AbsListView#postDelayed()
The following examples show how to use
android.widget.AbsListView#postDelayed() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ScrollUtils.java From NewsMe with Apache License 2.0 | 5 votes |
/** * 滚动列表到顶端 * * @param listView */ public static void smoothScrollListViewToTop(final AbsListView listView) { if (listView == null) { return; } smoothScrollListView(listView, 0); listView.postDelayed(new Runnable() { @Override public void run() { listView.setSelection(0); } }, 200); }
Example 2
Source File: ListScrollTracker.java From Dashchan with Apache License 2.0 | 5 votes |
@Override public void onScrollStateChanged(AbsListView view, int scrollState) { if (scrollState == SCROLL_STATE_IDLE) { view.postDelayed(this, 500); } else { view.removeCallbacks(this); } }
Example 3
Source File: ListViewUtils.java From FeedListViewDemo with MIT License | 5 votes |
/** * 滚动列表到顶端 * * @param listView */ public static void smoothScrollListViewToTop(final AbsListView listView) { if (listView == null) { return; } smoothScrollListView(listView, 0); listView.postDelayed(new Runnable() { @Override public void run() { listView.setSelection(0); } }, 200); }