Example usage for android.widget SimpleAdapter getCount

List of usage examples for android.widget SimpleAdapter getCount

Introduction

In this page you can find the example usage for android.widget SimpleAdapter getCount.

Prototype

public int getCount() 

Source Link

Usage

From source file:org.developfreedom.ccdroid.app.MainActivity.java

@Override
public void updateListView(List<Project> projects) {
    if (projects == null) {
        Toast.makeText(this, getString(R.string.toast_unable_to_fetch_project_list), Toast.LENGTH_SHORT).show();
        LOGE(TAG, "Error: project list came empty");
        return;/*w  ww . ja  v  a  2s  . co m*/
    }
    LOGD(TAG, "Starting listview update");
    SimpleAdapter adapter = getAdapterFor(projects);

    projectsListView = (ListView) findViewById(R.id.fragment_listview_projects);

    projectsListView.setAdapter(adapter);
    LOGD(TAG, "Adapter set to projects listview has " + adapter.getCount() + " items");

    projectsListView.setOnItemClickListener(new ListViewItemClickListener(projectsListView, this));
    if (swipeRefreshLayout != null && swipeRefreshLayout.isRefreshing()) {
        swipeRefreshLayout.setRefreshing(false);
    }
}