Java Code Examples for android.widget.ListView.getHeaderViewsCount()

The following are Jave code examples for showing how to use getHeaderViewsCount() of the android.widget.ListView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: decoy   File:   Source Code and License Vote up 6 votes
public static Object getViewHolderByIndex(ListView listView, int index) {
	int firstVisibleFeedPosition = listView.getFirstVisiblePosition() - listView.getHeaderViewsCount();
	int lastVisibleFeedPosition = listView.getLastVisiblePosition() - listView.getHeaderViewsCount();

	if (index >= firstVisibleFeedPosition && index <= lastVisibleFeedPosition) {
		View view = listView.getChildAt(index - firstVisibleFeedPosition);
		Object tag = view.getTag();
		return tag;
	} else {
		return null;
Example 2
Project: StickyNavigationBar   File:   Source Code and License Vote up 5 votes
private void initView() {
    mListView = (ListView) findViewById(;
    stickyNavHostRoot = (StickyNavHost) findViewById(;

    View testHeaderView = LayoutInflater.from(this).inflate(R.layout.listview_head_view_test_layout, null);

    View inflateView = LayoutInflater.from(this).inflate(R.layout.sticky_nav_host_layout, null);
    stickyNavHostHead = (StickyNavHost) inflateView.findViewById(;
    STICKY_POSITION_IN_HEADER = mListView.getHeaderViewsCount();
Example 3
Project: orgzly-android   File:   Source Code and License Vote up 5 votes
public void onListItemClick(ListView listView, View view, int position, long id) {
    if (BuildConfig.LOG_DEBUG) LogUtils.d(TAG, listView, view, position, id);

    if ((position+1) > listView.getHeaderViewsCount()) { /* Not a header. */
        listener.onNoteClick(this, view, position, id, id);

    } else {
        if (mBook != null) {
        } else {
            Log.e(TAG, "Book null on preface edit request");