Saturday, October 1, 2011

[android-developers] Re: HTTP response Problem

On Sep 27, 3:44 pm, "daniel_nyb...@hotmail.com"
<daniel_nyb...@hotmail.com> wrote:
> Help Me, please !
> I'm pretty new on Android, but I've been struggeling with this code 10
> hours now,  and needs help.
> I am trying to read the data from a web site, (in string format).
> The problem is that, after executed the row "response =
> client.execute(request);" it jumps directly to "}finally{"
> WHY????

The line of code threw an exception and you didn't catch it, so it
jumped to the finally block. After that, the caller of this function
would have to handle the exception because you declared this method as
"throws Exception" (which is usually a bad idea unless you really know
what you're doing). Try taking out the "throws Exception" and
handling exceptions in the method itself.

Doug

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment