title: How to add custom View to list adapter
body: <p>I have a listview which is being created by custom listadapter.In this list view i want one text and one view for every item of listview.I am getting able to add text.My view is a view which is a custom view.it is not adding.I do not know why? Anyone wanna help?</p>
  
  <pre><code>private class ItemsAdapter extends BaseAdapter{
      String[] items;
      Context context;
      public ItemsAdapter(Context context,String[] items){
          this.items=items;
          this.context=context;
      }
  
      public View getView(final int position,View convertView,ViewGroup Parent){
          TextView itemText;
          View image;
          View view=convertView;
          if(view==null){
              LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              view = vi.inflate(R.layout.listitem, null);
          }
  
          itemText=(TextView) view.findViewById(R.id.label);
           itemText.setText(items[position]);
  
          image=new SampleView(context);
          LinearLayout ln1=(LinearLayout)view.findViewById(R.id.ll1);
  
  
          ln1.addView(image,1);
           return view;
      }
      public int getCount() {
             return items.length;
            }
  
            public Object getItem(int position) {
             return position;
            }
  
            public long getItemId(int position) {
             return position;
            }
  }
  </code></pre>