HttpConnection failing on .connect() for image URL
<p>I'm trying to retrieve tweet information from a search query into my android application. I'm able to put the username and subject in the listview, but I have trouble grabbing the photo. Here is my GetView method from my adapter</p>

<pre><code> @Override
 public View getView(int position, View convertView, ViewGroup parent) {
        View v = convertView;
        if (v == null) {
            LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.listitem, null);
        }

        UserRecord user = users.get(position);
        if (user != null) {
            TextView username = (TextView) v.findViewById(R.id.username);
            TextView subject = (TextView) v.findViewById(R.id.subject);
            // Bitmap bitmap = DownloadImage(user.imageURL);
            ImageView img = (ImageView) v.findViewById(R.id.avatar);
            if (username != null) {
                username.setText(user.username);
            }

            if(subject != null) {
                subject.setText(user.subject);
            }

            if (img != null){
                try {
                    URL myURL = new URL(user.imageURL);
                    HttpURLConnection conn = (HttpURLConnection) myURL.openConnection();
                    conn.setDoInput(true);
                    conn.connect();
                    InputStream is = conn.getInputStream();
                    img.setImageBitmap(BitmapFactory.decodeStream(is));
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
        return v;
    }
</code></pre>

<p>I traced through my code and it fails on conn.connect() and jumps to the catch statement. Does anyone know why this is happening? I have internet connection enabled in my mainfest. Thanks!</p>
