Code example for GridView

Methods: setOnItemClickListener

0
    } 
 
    public void setOnItemClickListener(OnItemClickListener l) {
        mClickCaller = l;
        if (mGrid != null)
            mGrid.setOnItemClickListener(l);
    } 
 
    @Override 
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        if (savedInstanceState != null)
            mData = savedInstanceState;
        else 
            mData = getArguments();
        if (mData == null)
            mData = new Bundle();
        if (mData.containsKey("path"))
            mPath = (OpenPath)mData.getParcelable("path");
        mGrid = (GridView)inflater.inflate(R.layout.content_grid, container, false);
        mGrid.setNumColumns(container.getContext().getResources()
                .getInteger(R.integer.max_grid_columns));