issue with custom gridview android
<p>I have developed an app in which I display data in <code>Gridview</code>. All data comes from local storage. I am able to display each data correctly and there are no issues with it. But when I have scroll the <code>Gridview</code> and goto the bottom and getback to <code>Top</code>,it changes position. And sometimes when I scroll down and getback to Top, a blank screen appears on screen;no data found at all!
So I thought that there is issue with <code>getView()</code>. I am unable to figure out the problem</p>

<p><strong>Code of getView() ::</strong> </p>

<pre><code>@Override
public View getView(int position, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub
    ViewHolder viewholder;
    // LayoutInflater inflator = activit.getLayoutInflater();
    if(convertView == null) {
        // recycled view is null so create it.
        viewholder = new ViewHolder();
        convertView = inflator.inflate(R.layout.griedviewrow, null);
        viewholder.imgvGridicon = (ImageView) convertView.findViewById(R.id.imgvGridicon);
        viewholder.txtGridItemlabel = (TextView) convertView.findViewById(R.id.txtGridItemlabel);
        convertView.setTag(viewholder); 
    } else {
        viewholder = (ViewHolder) convertView.getTag();      
    }  
    if ((lstpinfo.get(position).appname.toString()) != null) {
        viewholder.imgvGridicon.setImageDrawable((lstpinfo.get(position).icon));
        viewholder.txtGridItemlabel.setText(lstpinfo.get(position).appname.toString());
    }
    return convertView;
}
</code></pre>

<p><strong>Update:: 
Intitalize of inflater::</strong></p>

<pre><code>private LayoutInflater inflator;

     private ArrayList&lt;PInfo&gt; lstpinfo = new ArrayList&lt;PInfo&gt;();
     public GriedViewAdapter(Context cntx, ArrayList&lt;PInfo&gt; lstpinfo) {

            activit = cntx;
            inflator = LayoutInflater.from(cntx);
            this.lstpinfo = lstpinfo;

        }
</code></pre>
