Note that there are some explanatory texts on larger screens.

plurals
  1. POgridview image with icon and text
    text
    copied!<p>@@ Branislav-i did same as wat u have said.and it worked for me but wen no of images exceeded to 9 n text also it strted showing me same 1st or ant random image and text at the place of 9th image and text </p> <pre><code>public class ImageAdapter extends BaseAdapter { private Context mContext; public ImageAdapter(Context c) { mContext = c; } public int getCount() { return mThumbIds.length; } public Object getItem(int position) { return null; } public long getItemId(int position) { return 0; } // create a new ImageView for each item referenced by the Adapter public View getView(int position, View convertView, ViewGroup parent) { View v; if (convertView == null) { // if it's not recycled, initialize some attributes LayoutInflater li = getLayoutInflater(); v = li.inflate(R.layout.mainmenu, null); TextView tv = (TextView)v.findViewById(R.id.icon_text); tv.setText(mTextsIds[position]); ImageView iv = (ImageView)v.findViewById(R.id.icon_image); iv.setImageResource(mThumbIds[position]); } else { v = (View) convertView; } return v; } private Integer[] mThumbIds = { R.drawable.hotel1, R.drawable.rest,R.drawable.dubaicityinfoicon_new,R.drawable.history1,R.drawable.geography,R.drawable.infoicon,R.drawable.infoicon,R.drawable.infoicon,R.drawable.parkmain, }; // references to our texts private String[] mTextsIds = { "Hotels","Restaurants","City Info","Dubai History","Geography Of Dubai","Useful Information","Embassies in Duabai","Museum's","park" }; </code></pre> <p>in this it s going perfect till museum but for park its not working it is showing any random image n associated text within the array mThumbIds. plz plz urgetn help needed.. n yah image is available in drawable.</p>
 

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