ListView addHeaderView - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ListView addHeaderView method.

This code example shows how to use the following methods: addHeaderView, setAdapter, setEmptyView, setFocusable, setOnItemClickListener
		super.onCreate(savedInstanceState);
 
		if (listViewId != 0) {
			listView = findListViewById(listViewId);
			if (headerView() != null) { 
				listView.addHeaderView(headerView());
			} 
			listView.setOnItemClickListener(this);
			android.view.View emptyView = findViewById(android.R.id.empty);
			if (emptyView != null) {
				listView.setEmptyView(emptyView);
			} 
 
			adapter = Objects.createInstance(adapterClass, Context.class, this);
			listView.setAdapter(adapter);
			listView.setFocusable(true);
		} 
	} 
 
	/** 
	 * Called after ListAdapter has been loaded 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: addHeaderView
		LinearLayout outerContainer = new LinearLayout(context);
		AbsListView.LayoutParams layoutParams = new AbsListView.LayoutParams(AbsListView.LayoutParams.FILL_PARENT, AbsListView.LayoutParams.WRAP_CONTENT);
		outerContainer.setLayoutParams(layoutParams);
		outerContainer.setOrientation(LinearLayout.VERTICAL);
		outerContainer.addView(subView);
		listView.addHeaderView(outerContainer);
	} 
	 
	@Override 
	public HeaderVisibility createVisibility(ListView listView, View subView)
	{ 
		return new HeaderVisibility(subView);
	} 
} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setAdapter, addHeaderView
	private void populateHeaderView() { 
		// TODO: Populate the damn header.  
	} 
	 
	private void populateMainView() { 
		listView.addHeaderView(headerView);
		listView.setAdapter(episodeArchiveAdapter);
	} 
	 
	private class LoadEpisodesAsyncTask extends AsyncTask<Void, Void, List<Episode>> {
		@Override 
		protected List<Episode> doInBackground(Void... params) {
			try { 
				return IBClient.getEpisodes(0, 10); 
			} catch (IOException e) {
				e.printStackTrace();
				return null; 
			} 
		} 
		 
Full Snippet Info
4
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related ListView addHeaderView Questions & Answers:

addHeaderView Method Overview
Add a fixed view to appear at the top of the list.
See Code Examples for other Android ListView Methods: