i am using this code // Image saved code here ----- private Bitmap LoadImage(String URL, BitmapFactory.Options options) { Bitmap bitmap = null; InputStream in = null; try { in = OpenHttpConnection(URL); bitmap = BitmapFactory.decodeStream(in, null, options); in.close(); } catch (IOException e1) { } return bitmap; } //end of loadImages() private InputStream OpenHttpConnection(String strURL) throws IOException{ InputStream inputStream = null; URL url = new URL(strURL); URLConnection conn = url.openConnection();
try{ HttpURLConnection httpConn = (HttpURLConnection)conn; httpConn.setRequestMethod("GET"); httpConn.connect(); if (httpConn.getResponseCode() == HttpURLConnection.HTTP_OK) { inputStream = httpConn.getInputStream(); } } catch (Exception ex) { } return inputStream; } //end of OpenHttpConnection() // end of image saved link and : ImageButton IBtnSave = (ImageButton) findViewById(R.id.iBtnSave); IBtnSave.setVisibility(View.INVISIBLE); Toast.makeText(getApplicationContext(), "Resume", 2500).show(); // ImageView img = (ImageView) findViewById(R.id.imageView1); // BitmapFactory.Options bmOptions; // bmOptions = new BitmapFactory.Options(); // bmOptions.inSampleSize = 1; // bm = LoadImage(myurl, bmOptions); // extStorageDirectory = Environment.getExternalStorageDirectory().toString(); // // IBtnSave.setOnClickListener(new View.OnClickListener() // { // public void onClick(View v) // { // // TODO Auto-generated method stub // OutputStream outStream = null; // File file = new File(extStorageDirectory, "Snap.JPEG"); // try // { // outStream = new FileOutputStream(file); // bm.compress(Bitmap.CompressFormat.JPEG, 100, outStream); // outStream.flush(); // outStream.close(); // // Toast.makeText(KillrudderyLiveViewActivity.this, "Saved", Toast.LENGTH_LONG).show(); // } // catch (FileNotFoundException e) // { // // TODO Auto-generated catch block // e.printStackTrace(); // Toast.makeText(KillrudderyLiveViewActivity.this, e.toString(), Toast.LENGTH_LONG).show(); // } // catch (IOException e) // { // // TODO Auto-generated catch block // e.printStackTrace(); // Toast.makeText(KillrudderyLiveViewActivity.this, e.toString(), Toast.LENGTH_LONG).show(); // } // } // }); // end of listener But its does not work :( what is wrong in this -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en