title: (exception Resources$NotFoundException))ListView.layoutChildren() line: 1596
body: <p>I am trying to create a list with a custom List item cell in a completely programatic way (without using any xml). I am running into below error. After several hours of searching on the web, I am writing this as my first question on Stack Overflow.</p>
  
  <p>Appreciate your inputs on this &amp; any suggestions on how to better handle Android programming without using the R.*.xml</p>
  
  <p><strong>On running this code, I get the below error:</strong></p>
  
  <p>(Suspended (exception Resources$NotFoundException))</p>
  
  <p>ListView.layoutChildren() line: 1596</p>
  
  <p>ListView(AbsListView).onLayout(boolean, int, int, int, int) line: 1112</p>
  
  <p>ListView(View).layout(int, int, int, int) line: 6569    </p>
  
  <p>FrameLayout.onLayout(boolean, int, int, int, int) line: 333 
  ...</p>
  
  <p><strong>Code:</strong></p>
  
  <p>public class MyList extends ListActivity{</p>
  
  <pre><code>static final ArrayList&lt;HashMap&lt;String,String&gt;&gt; list = 
      new ArrayList&lt;HashMap&lt;String,String&gt;&gt;();
  
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  </code></pre>
  
  <p>//CUSTOM LIST</p>
  
  <pre><code>    LinearLayout mainLayout=new LinearLayout(this);
      ListView myListView=new ListView(this);
      mainLayout.addView(myListView);
  
  
      LinearLayout ListItemLayout=new LinearLayout(this);
      TextView title = new TextView(this);
      TextView author = new TextView(this);
      TextView price = new TextView(this);
      ListItemLayout.addView(title);
      ListItemLayout.addView(author);
      ListItemLayout.addView(price);
  
      SimpleAdapter adapter = new SimpleAdapter(
          this,
          list,
          ListItemLayout.getId(),
          new String[] {"title","author","price"},
          new int[] {ListItemLayout.getChildAt(0).getId(),ListItemLayout.getChildAt(1).getId(),ListItemLayout.getChildAt(2).getId()}
      );     
      populateList();
      setListAdapter(adapter);  
  
  }
  
  private void populateList() {
      HashMap&lt;String,String&gt; map = new HashMap&lt;String,String&gt;();
      map.put("title",
  "Professional Android ");
      map.put("author", "Meier");
      map.put("price", "$54.99");
      list.add(map);
      map = new HashMap();
      map.put("title","Android 2");
      map.put("author", 
  "Sayed");
      map.put("price", "$48.98");
      list.add(map);
      }
  </code></pre>
  
  <p>}</p>