This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Android and the fly likes android.os.networkonmainthreadexception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "android.os.networkonmainthreadexception" Watch "android.os.networkonmainthreadexception" New topic
Author

android.os.networkonmainthreadexception

Satchidananda Mohanty
Ranch Hand

Joined: Mar 12, 2008
Posts: 77

Hello,

I have a jax-ws webservice which I want to call from my android application. The code is mentioned below.



AndroidMainfest File :



I have included ksoap2-android-full-2.1.2.jar too.



But while running this code it shows "android.os.networkonmainthreadexception"

Kindly provide your precious solution to overcome this.

Thanking you.


Zeet

SCJP 6.0
Satchidananda Mohanty
Ranch Hand

Joined: Mar 12, 2008
Posts: 77

Hi

Please find the webservice code details which works fine from normal java web application.





Thanks ,
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Post the full stack trace. In which line of code does it occur?
Satchidananda Mohanty
Ranch Hand

Joined: Mar 12, 2008
Posts: 77

Hi,

This issue has been resolved by adding this code in the onCreate method.



Thanks,
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: android.os.networkonmainthreadexception