On Thu, Sep 20, 2012 at 8:46 AM, SoftMan <[email protected]> wrote:
> Hello. I had an app that run well in 2.3. I read that in gingerbread and
> higher I can't run a network operation in main thread, and that I should use
> AsyncTask. I made that, but it still gives me that error. In the Galaxy
> SIII, the app run with error and does not load the data. I tried with the
> emulator using the same OS version, and load the data call from the
> database, but the logcat  still print the error
> "android.os.NetworkOnMainThreadException".

There is no AsyncTask involved in the following portion of your stack trace:

> 09-20 07:57:25.452: E/ServicioRest(1506): at
> com.silm.notification.request.OrderRequestParser.listOrderRequest(OrderRequestParser.java:42)
> 09-20 07:57:25.452: E/ServicioRest(1506): at
> com.silm.notification.request.DataLoader.getOrderRequestArray(DataLoader.java:18)
> 09-20 07:57:25.452: E/ServicioRest(1506): at
> com.silm.notification.fragments.BottomPanel.onCreateView(BottomPanel.java:57)

> I also read that changing the StrictMode policy, it could be done.

AFAIK, that does not work. Please simply fix your code.

> But is better to use AsyncTask. But I am using AsyncTask!

Not from BottomPanel.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 4.1 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to