Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8262765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:51:49+00:00 2026-06-08T03:51:49+00:00

In my Android app I use a thread to download an image from the

  • 0

In my Android app I use a thread to download an image from the internet, but for some reason when I run the app on my galaxy nexus a networkonmainthread exception is thrown but not if I run the app in the emulator (tested Android Versions 2.3.3 and 4.0.3).

Thread ImageLoaderThread = new Thread(new Runnable() {
public void run() {

 bitmap= DrawableManager.fetchDrawable(URL);

 });

Because the GUI starts slowly when I start the thread directly on start-up I get the impression, that the thread indeed runs on the GUI thread…but why???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:51:50+00:00Added an answer on June 8, 2026 at 3:51 am

    It depends on how you build. You are building using Honeycomb SDK (for Android 3.0 and higher) when building for the device. NetworkOnMainThreadException is never thrown with older SDKs.

    You are not using the same SDK for the emulator, at least not when building to test on 2.3.3. If you use the same build configuration when testing on 2.3.3 and 4.0.3, that would completely explain all the results you are seeing.

    Accessing the network on the main thread was never considered good practice (the concern is UI responsiveness as no other thread can serve the UI while you are waiting for network to respond), but it was not strictly banned in the API until Honeycomb.

    Read this tutorial to move your network access into an AsyncTask.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use Log functions to debug my Android app. I'm close to releasing my
I' m developing an Android app wich requires me to use a Database. After
I am a new android app developer and i want to use google map
In my Android app, I want to use my existing sqlite database.I followed http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/
I want to use MoPub for putting ads in my Android app. I have
I am developping an Android app, and I need to use java Signature class
I'm working on an Android app in which I would like to use multi-touch.
I'm trying to use JSoup in my android app to parse a certain website.
I am working on an android app and have to use remote database for
I am currently developing an Android-App in Eclipse and trying to use a Library

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.