Java Code Examples for android.widget.AbsListView#setEmptyView()

The following examples show how to use android.widget.AbsListView#setEmptyView() . 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: LibraryFragment.java    From TextFiction with Apache License 2.0 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {
	View view = inflater.inflate(R.layout.fragment_library, null, false);

	// Set the adapter
	mListView = (AbsListView) view.findViewById(android.R.id.list);
	mListView.setEmptyView(view.findViewById(android.R.id.empty));
	((AdapterView<ListAdapter>) mListView).setAdapter(mAdapter);

	// Set OnItemClickListener so we can be notified on item clicks
	mListView.setOnItemClickListener(this);
	
	reScan();
	return view;
}
 
Example 2
Source File: WhiteListFragment.java    From android-overlay-protection with Apache License 2.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_whitelist, container, false);

    // Set the adapter
    mListView = (AbsListView) view.findViewById(android.R.id.list);
    mListView.setEmptyView(view.findViewById(android.R.id.empty));
    mListView.setAdapter(mAdapter);

    // Set OnItemClickListener so we can be notified on item clicks
    mListView.setOnItemClickListener(this);

    return view;
}
 
Example 3
Source File: DetectedOverlayFragment.java    From android-overlay-protection with Apache License 2.0 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_detectedoverlay, container, false);

    // Set the adapter
    mListView = (AbsListView) view.findViewById(android.R.id.list);
    mListView.setEmptyView(view.findViewById(android.R.id.empty));
    mListView.setAdapter(mAdapter);

    // Set OnItemClickListener so we can be notified on item clicks
    mListView.setOnItemClickListener(this);

    return view;
}