Example usage for android.widget ListView ListView

List of usage examples for android.widget ListView ListView

Introduction

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

Prototype

public ListView(Context context, AttributeSet attrs) 

Source Link

Usage

From source file:com.github.michalbednarski.intentslab.editor.ComponentPickerDialogFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Abort if nothing found, onCreate called dismiss()
    if (mChoices == null) {
        return null;
    }//from  w ww . j ava 2s  .  com

    // Create list
    ListView lv = new ListView(getActivity(), null);
    lv.setId(android.R.id.list);
    lv.setAdapter(new Adapter());
    Utils.fixListViewInDialogBackground(lv);
    lv.setOnItemClickListener(this);
    lv.setOnItemLongClickListener(this);
    return lv;
}