I am connecting to a web service using
urlConnection.connect();
This works only in AsyncTask. I am not able to execute the above statement on plain activity (without AsyncTask )
Is it the behavior by design, or I am missing something.
By the way, this is my first question
Answer
Welcome to stackoverflow. please use google search and stackoverflow search before posting a question. the chnaces are big, that someone else had already asked your question. stackoverflow rules
Network communications must be done in seprate Thread in android.
Read more about it here developer wiki
No comments:
Post a Comment