Does your app crashes/throws exception on execute()
? If so, you most likely getting NetworkOnMainThreadException exception - it is related to networking on UI thread (i.e trying to network directly in your Activity class). You have to separate networking and run this code asynchrously (usually using IntentService
or AsyncTask
).
See this article for more information.
BTW: next time always post your logcat output with your question