Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Don't use an <code>ArrayAdapter</code>, create a class that extends <code>BaseAdapter</code> to create your own custom adapter.</p> <p>Then in the getView method, inflate an xml layout for each cell of your grid ( your can place TextViews, EditText, images or whatever you want in it.)</p> <p>The overriden getView method will look like : </p> <pre><code> @Override public View getView(int position, View convertView, ViewGroup parent) { View cell; if(convertView==null){ cell= new View(context); //create a file "cell_layout.xml" in your layout folder to define the layout for each cell cell= layoutInflater.inflate(R.layout.cell_layout, null); }else{ cell= (View)convertView; } ImageView imageView = (ImageView)cell.findViewById(R.id.image); imageView.setImageBitmap(bitmap[position]); TextView textView = = (TextView)cell.findViewById(R.id.text); textView .setText("hello world from gridView"); return cell; } </code></pre> <p>A more complete example can be find <a href="http://sunil-android.blogspot.fr/2013/01/custom-adapter-on-both-gridview-and.html" rel="nofollow">here</a> but a lot of examples can be found by googling "Custom Adapter"</p> <p>The problem of loading a picture from an url is another topic, the answer from Armaan seems good. I would suggest you to have a look at the <a href="https://github.com/cyrilmottier/GreenDroid" rel="nofollow">GreenDroid project</a> and particularly it <a href="http://greendroid.cyrilmottier.com/reference/greendroid/widget/AsyncImageView.html" rel="nofollow">AsynImageView</a> that I used a lot.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload