• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Just a quick question, might be an easy fix :)

how do i declare URL variables

i tried this, but the "URL"s are marked as errors

Code:
URL url = new URL("URL.goes.here.com");

URL cannot be resolved to a type, is what eclipse tells me :(

Thanks in advance
-me
 
"URL" in your code should have some squiggles under it. Hover over it and there may be an option to "import." You should select that, then your error will go away.

Or, if you don't see that, then add :
"import java.net.URL;"

to your code. That's how Eclipse will recognize urls in your code.
 
Back
Top Bottom