Probably you are trying to perform network operation on UI thread, which Android 3.0+
devices won't allow. They will throw an exception indicating that you are performing network operation on UI thread.
Try to use AsyncTask
or separate Thread
to perform network operation.