Example usage for android.widget AdapterView setEmptyView

List of usage examples for android.widget AdapterView setEmptyView

Introduction

In this page you can find the example usage for android.widget AdapterView setEmptyView.

Prototype

@android.view.RemotableViewMethod
public void setEmptyView(View emptyView) 

Source Link

Document

Sets the view to show if the adapter is empty

Usage

From source file:com.handlerexploit.prime.example.activities.GridViewExample.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.grid_content);

    mLazyImageAdapter = new LazyImageAdapter(this, R.layout.grid_item);

    @SuppressWarnings("unchecked")
    AdapterView<LazyImageAdapter> adapterView = (AdapterView<LazyImageAdapter>) findViewById(android.R.id.list);
    adapterView.setEmptyView(findViewById(R.id.progressContainer));
    adapterView.setAdapter(mLazyImageAdapter);

    getSupportLoaderManager().initLoader(0, null, this);
}

From source file:com.handlerexploit.prime.example.activities.ListViewExample.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.list_content);

    mLazyImageAdapter = new LazyImageAdapter(this, R.layout.list_item);

    @SuppressWarnings("unchecked")
    AdapterView<LazyImageAdapter> adapterView = (AdapterView<LazyImageAdapter>) findViewById(android.R.id.list);
    adapterView.setEmptyView(findViewById(R.id.progressContainer));
    adapterView.setAdapter(mLazyImageAdapter);

    getSupportLoaderManager().initLoader(0, null, this);
}