Im displaying the thumbnails of images in a gridview those are stored in the server .
Now im trying to display the actual image of the thumbnail according to user selection.
When i select any thumbnail at the first time, it works fine and displaying the actual image. Now if i select the
back button and again select another thumbnail, it gives error. Now again if i select the same thumbnail, it works fine.So my alternate selections are giving an error..
this is my code
Using java Syntax Highlighting
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.storageimage);
- iv = (ImageView) findViewById(R.id.storageimg);
- Intent i = getIntent();
- Bundle extras = i.getBundleExtra("extra");
- url = extras.getString("url");
- try
- {
- URL myURL=new URL(url);
- final URLConnection ucon = myURL.openConnection();
- ucon.connect();
- final BufferedInputStream bis=new BufferedInputStream(ucon.getInputStream());
- final Bitmap bm = BitmapFactory.decodeStream(bis);
- bis.close();
- iv.setImageBitmap(bm);
- }
- catch(Exception e)
- {
- }
- }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
Im getting the correct url for every selection. InputStream also not null..
Can anybody help me in this?
Thanks,
Ramesh.

