how to display images in gridview from url
<p>Hi when i am trying this code to dipaly images from imageurl in gridview 
it is showing null pointer exception can any one help me:
my code is</p>

<p>public class Gridview extends Activity {</p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_gridview);

    GridView gridview = (GridView) findViewById(R.id.gridview);   
    gridview.setAdapter(new ImageAdapter(this));
</code></pre>

<p>}
    public class ImageAdapter extends BaseAdapter{</p>

<pre><code>    private Context mContext;
    private Integer[] mThumbIds;
 public ImageAdapter(Context c) {
    mContext = c;     
}
public int getCount() {
    return mThumbIds.length;
}
public Object getItem(int position) {
    return position;
}
public long getItemId(int position) {
    return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
    ImageView imageView;
    if (convertView == null) {
        imageView = new ImageView(mContext);
        imageView.setLayoutParams(new GridView.LayoutParams(45, 45));
        imageView.setAdjustViewBounds(false);
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        imageView.setPadding(8, 8, 8, 8);
    } else {
        imageView = (ImageView) convertView;
    }
    imageView
            .setImageDrawable(LoadImageFromWebOperations("http://tmcrmappsqa.inservices.tatamotors.com/cordys/Images/mobile.png"+position));
    return imageView;
}
protected Drawable LoadImageFromWebOperations(String url) {
    try {
        InputStream is = (InputStream) new URL(url).getContent();
        Drawable d = Drawable.createFromStream(is, "src name");
        return d;
    } catch (Exception e) {
        System.exit(0);
        return null;
    }
}






}    
</code></pre>
