Code example for AbsListView.LayoutParams

0
     * create root for item of ListView 
     */ 
    protected ViewGroup createRoot(){
        LinearLayout root = new LinearLayout(mContext);
        root.setOrientation(LinearLayout.HORIZONTAL);
        LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
        root.setLayoutParams(lp);
        return root;
    } 
     
    private boolean setOnItemClickListenerIfNeed(View child,int pos,int realPos) {
        if(mGridListener == null){
            return false; 
        } 
        child.setOnClickListener(this);
        child.setTag(R.id.pos, pos);
        child.setTag(R.id.realPos, realPos);
        return true; 
    } 
     
    public void setOnItemClickListener(OnGridItemClickListener listener){