I am creating an app which dynamically load pictures from script and display them in grid view.

Here is 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) {
        ImageView imageView;
        if (convertView == null) {
            // if it's not recycled, initialize some attributes
            imageView = new ImageView(mContext);
            imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
            imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
            imageView.setPadding(8, 8, 8, 8);
        } else {
            imageView = (ImageView) convertView;
        }

        imageView.setImageResource(mThumbIds[position]);
        return imageView;
    }

    private String[] mThumbIds = new String[]{
            "http://localhost/comic_app/index.php?id=1",
            "http://localhost/comic_app/index.php?id=67",
            "http://localhost/comic_app/index.php?id=4",
            "http://localhost/comic_app/index.php?id=89",
            "http://localhost/comic_app/index.php?id=98",
            "http://localhost/comic_app/index.php?id=23",
            "http://localhost/comic_app/index.php?id=45",
    };
}

```

I am getting compile time error on 

> 
> imageView.setImageResource(mThumbIds[position]);
> 
> 
> Error: cannot be applied to (java.lang.String)
> 
> 
> 

I know setImageResource wants to get int but how to do that.
Thanks in advance