my dog learned polymorphism*
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 Java 8 in Action this week in the Java 8 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,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: android.os.networkonmainthreadexception
 
Similar Threads
it doesn't shows location details
shows me blank with blinking arrow
list view problem
telephonyManager.getCellLocation() gives null
It doesn't provide me expected output