title: ListView with images only
body: <p>I was just asking myself if there was a way of making a ListView without any texts. I've only found ListViews with images + texts, and that exactly what i dont want. I just want to add a lot of images like in a list and don't want to make it with ImageView because that makes my app crash. Also, i dont want my app to lag. Thanks!</p>
  
  <p>this is what i got in my activity_main.xml </p>
  
  <pre><code>&lt;ListView
  android:id="@+id/listview"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  </code></pre>
  
  <p>/></p>
  
  <p>and i found this from another post that actually helped me, but it doesnt display all images</p>
  
  <pre><code>public class MainActivity extends Activity {
  
  
  // Array of integers points to images stored in /res/drawable-hdpi/
  int[] vehs = new int[]{
      R.drawable.veh1,
      R.drawable.veh2,
      R.drawable.veh3,
      R.drawable.veh4,
      R.drawable.veh5,
      R.drawable.veh6,
      R.drawable.veh7,
      R.drawable.veh8,
      R.drawable.veh9,
      R.drawable.veh10,
      R.drawable.veh11,
      R.drawable.veh12,
      R.drawable.veh13,
      R.drawable.veh14,
      R.drawable.veh15,
      R.drawable.veh16,
      R.drawable.veh17,
      R.drawable.veh18,
      R.drawable.veh19,
      R.drawable.veh20,
      R.drawable.veh21,
      R.drawable.veh22,
      R.drawable.veh23,
      R.drawable.veh24,
      R.drawable.veh25,
      R.drawable.veh26,
      R.drawable.veh27,
      R.drawable.veh28,
      R.drawable.veh29,
      R.drawable.veh30,
      R.drawable.veh31,
      R.drawable.veh32,
      R.drawable.veh33,
      R.drawable.veh34,
      R.drawable.veh35,
      R.drawable.veh36,
  };
  
  
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      // Each row in the list stores country name, currency and flag
      List&lt;HashMap&lt;String,String&gt;&gt; aList = new ArrayList&lt;HashMap&lt;String,String&gt;&gt;();
  
      for(int i=0;i&lt;10;i++){
          HashMap&lt;String, String&gt; hm = new HashMap&lt;String,String&gt;();
          hm.put("vehs", Integer.toString(vehs[i]) );
          aList.add(hm);
      }
  
      // Keys used in Hashmap
      String[] from = { "vehs","txt","cur" };
  
      // Ids of views in listview_layout
      int[] to = { R.id.vehs,R.id.txt,R.id.cur};
  
      // Instantiating an adapter to store each items
      // R.layout.listview_layout defines the layout of each item
      SimpleAdapter adapter = new SimpleAdapter(getBaseContext(), aList, R.layout.listview_layout, from, to);
  
      // Getting a reference to listview of main.xml layout file
      ListView listView = ( ListView ) findViewById(R.id.listview);
  
      // Setting the adapter to the listView
      listView.setAdapter(adapter);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Didn't edit all the code, so you might find some things confusing xD</p>