File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring 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,
 
wood burning stoves
 
subject: android.os.networkonmainthreadexception