Example usage for android.widget GridView setAdapter

List of usage examples for android.widget GridView setAdapter

Introduction

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

Prototype

@Override
public void setAdapter(ListAdapter adapter) 

Source Link

Document

Sets the data behind this GridView.

Usage

From source file:Main.java

public static void fillGrid(Context context, GridView lv, List<Drawable> ls) {
    ArrayAdapter<Drawable> adapter = new ArrayAdapter<>(context, android.R.layout.simple_list_item_1, ls);
    lv.setAdapter(adapter);
}

From source file:com.laevatein.internal.ui.helper.SelectedGridViewHelper.java

public static void setUpGridView(Fragment fragment, ItemViewResources resources,
        SelectedUriCollection collection) {
    GridView gridView = (GridView) fragment.getView().findViewById(R.id.l_grid_photo);
    SelectedPhotoAdapter adapter = new SelectedPhotoAdapter(fragment.getActivity(), resources, collection);
    adapter.registerCheckStateListener((SelectedPhotoAdapter.CheckStateListener) fragment);
    gridView.setAdapter(adapter);

    TextView emptyMessage = (TextView) fragment.getView().findViewById(R.id.l_label_empty);
    emptyMessage.setText(R.string.l_empty_selection);
    gridView.setEmptyView(emptyMessage);
}

From source file:com.laevatein.internal.ui.helper.PhotoGridViewHelper.java

public static void setUpGridView(Fragment fragment, ItemViewResources resources,
        SelectedUriCollection collection, AlbumPhotoAdapter.BindViewListener listener) {
    GridView gridView = (GridView) fragment.getView().findViewById(R.id.l_grid_photo);
    AlbumPhotoAdapter adapter = new AlbumPhotoAdapter(fragment.getActivity(), null, resources, collection,
            listener);//w w  w  . ja  va  2  s.c o  m
    adapter.registerCheckStateListener((AlbumPhotoAdapter.CheckStateListener) fragment);
    gridView.setAdapter(adapter);

    TextView emptyMessage = (TextView) fragment.getView().findViewById(R.id.l_label_empty);
    emptyMessage.setText(R.string.l_empty_photo);
    gridView.setEmptyView(emptyMessage);
}

From source file:com.example.client.fragment.imported.ScrollFragment.java

protected void setDummyData(GridView gridView) {
    gridView.setAdapter(new ArrayAdapter<>(getActivity(), android.R.layout.simple_list_item_1, getDummyData()));
}

From source file:com.aaa.activity.main.BaseFragment.java

protected void setDummyData(GridView gridView) {
    gridView.setAdapter(
            new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, getDummyData()));
}

From source file:com.starim.android.apps.travelplanner.TravelItemTransitionFragment.java

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    GridView grid = (GridView) view.findViewById(R.id.grid);
    grid.setAdapter(mAdapter);
}

From source file:com.github.ksoichiro.android.observablescrollview.sampler.BaseActivity.java

protected void setDummyData(GridView gridView) {
    gridView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, getDummyData()));
}

From source file:com.example.android.fragmenttransition.FragmentTransitionFragment.java

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    GridView grid = (GridView) view.findViewById(R.id.grid);
    grid.setAdapter(mAdapter);
    grid.setOnItemClickListener(this);
}

From source file:com.cnpaypal.ObservableScrollView.BaseActivity.java

protected void setDummyData(GridView gridView) {
    gridView.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, getDummyData()));
}

From source file:com.dev.foundingfourfathers.alchemy.BrowseCocktails.FragmentTransitionFragment.java

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    GridView grid = (GridView) view.findViewById(R.id.grid);
    grid.setAdapter(dAdapter);
    grid.setOnItemClickListener(this);
}