I close the stream when download is finished. There is now exception.
try{
        while( (c = in.read(chunk, 0, 2)) != -1)
        {
                 out.write(chunk, 0, c);
        }

   }
  catch(IOException ex)
 {
        Log.d("ex",ex);
 }
try{
      if(dos != null)
      {
        out.flush();
        out.close();
      }
   }catch(IOException ex)
   {
        Log.d("ex",ex.getLocalizedMessage());
}


On Apr 28, 5:44 am, TreKing <treking...@gmail.com> wrote:
> On Tue, Apr 27, 2010 at 10:37 AM, vanesa <olivera...@gmail.com> wrote:
> > How can I avoid such situation  ?
>
> Maybe try closing the stream and catching any exceptions that get thrown
> there?
>
> -------------------------------------------------------------------------------------------------
> TreKing - Chicago transit tracking app for Android-powered 
> deviceshttp://sites.google.com/site/rezmobileapps/treking
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow 
> athttp://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> android-beginners+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-beginners?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to