title: Gridview inside listview in android facing android.view.InflateException problems
body: <p>I have to create the custom gridview within text and listview in android application.</p>
  
  <p>Here i have to display the category name on gridview and if the  categoryname is matches which means have to display the list is display on listview below the corresponding categoryname.here i have referred the below tutorial:<a href="http://www.rdcworld-android.blogspot.in/2011/09/grid-view-demo-with-images.html" rel="nofollow">my reference tutorial</a></p>
  
  <p>I have displayed category name on gridview.here if the catagory name is notchbolly which means the gridview list items display on horizontal listview above the notchbolly category name.</p>
  
  <p>But here i have to run the app means the else part only executed on all category name.whats wrong in my code.pls give me solution for these...</p>
  
  <p>I have used below code:</p>
  
  <pre><code>public class LazyAdapter extends BaseAdapter {
  private Activity activity;
  private ArrayList&lt;HashMap&lt;String, String&gt;&gt; data;
  private static LayoutInflater inflater = null;
  public ImageLoader imageLoader;
  ListAdapter adapter;
  public LazyAdapter(Activity a, ArrayList&lt;HashMap&lt;String, String&gt;&gt; d) {
      activity = a;
      data = d;
      inflater = (LayoutInflater) activity
              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      imageLoader = new ImageLoader(activity.getApplicationContext());
  }
  
  public int getCount() {
      return data.size();
  }
  
  public Object getItem(int position) {
      return position;
  }
  
  public long getItemId(int position) {
      return position;
  }
  
  public View getView(int position, View convertView, ViewGroup parent) {
      View vi = convertView;
      if (convertView == null)
          vi = inflater.inflate(R.layout.list_row, null);
  
      TextView title = (TextView) vi.findViewById(R.id.title); 
      ListView imageView = (ListView) vi
              .findViewById(R.id.grid_item_image);
  
              HashMap&lt;String, String&gt; item = new HashMap&lt;String, String&gt;();
      item = data.get(position);
      // Setting all values in listview
      title.setText(item.get(MainActivity.KEY_TITLE));
  
          if (item.equals("notchbolly")) {
                   listview.setAdapter(this);
              }  else {
                      listview.setBackgroundResource(R.drawable.rihanna);
                  } 
           return vi;
                 }
  </code></pre>
  
  <p><strong>MainActivity.java:</strong></p>
  
  <pre><code>public class MainActivity extends Activity {
    static final String URL = "http://webservices/new_feed_articls.xml";
   static String KEY_CATEGORY = "Categories";
   static final String KEY_TITLE = "Category";
   static final String KEY_TITLENAME = "name";
  
   LazyAdapter adapter;
  
   @Override
      public void onCreate(Bundle savedInstanceState) {
  
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
        final ArrayList&lt;HashMap&lt;String, String&gt;&gt; songsList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
      XMLParser parser = new XMLParser();
          String xml = parser.getXmlFromUrl(URL); // getting XML from URL
          Document doc = parser.getDomElement(xml); // getting DOM element
  
          NodeList nl = doc.getElementsByTagName(KEY_TITLE);
  
          // looping through all song nodes &amp;lt;song&amp;gt;
          for (int i = 0; i &lt; nl.getLength(); i++) {
              // creating new HashMap
              HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;   ();
              Element e = (Element) nl.item(i);
               map.put( KEY_TITLE,((Element)nl.item(i)).getAttribute(KEY_TITLENAME));
               // map.put(KEY_TITLE, parser.getValue(e, KEY_TITLE));
              songsList.add(map);
          }
          GridView list = (GridView) findViewById(R.id.listView1);
      adapter = new LazyAdapter(this, songsList);
       list.setAdapter(adapter);
  </code></pre>
  
  <p>please give me solution for these.whats wrong in my code ???? </p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>list_row.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical"
     &gt;
  
    &lt;com.example.notch.HorizontalListView
  android:id="@+id/grid_item_image"
  android:layout_width="fill_parent"
  android:layout_height="50dp"
  android:background="#FFFFFF"
   /&gt;
  &lt;TextView
      android:id="@+id/title"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
  
      &gt;
  &lt;/TextView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>activity_main.xml</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent" 
  android:background="#FFFFFF"
  android:orientation="vertical"&gt;
  
   &lt;GridView
  android:id="@+id/listView1"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="#FFFFFF"
  /&gt;
  </code></pre>
  
  <p></p>
  
  <p>I have displayed category name on gridview.here if the catagory name is notchbolly which means the gridview list items display on horizontal listview above the notchbolly category name.</p>
  
  <p>But here i have to run the app means the else part only executed on all category name.whats wrong in my code.pls give me solution for these...</p>
  
  <p>Here the else part only executed...</p>