Questions tagged [background-thread]

A background thread is a thread that not directly driving the application but does some processing asynchronously.

Many UI toolkits require the use of background threads for anything that takes longer than a couple of milliseconds in order to keep the UI responsive.

Background threads are referred to as daemon threads at times.

Often background threads take care of recurring tasks, like cleaning up caches or similar.

Since the term 'background thread' is not very specific you might want to consider more specific tags related to the actual technology you are using.

If your question is independent of the actual technology this tag is a good fit.

Background Thread in .Net
Background thread in java

224 questions
0
votes
1 answer

Android multi-threading connection game

I'm creating a multiplayer game. Now I came to the point that I need to fetch and keep track of all the incoming server messages on the client side. I saw an AsynTask class to do background work for me. Do you think this is the way to go to keep…
0
votes
1 answer

Android background thread and activity relation?

My android app uses AsyncTask to download some data from a website. But when I press the back button of my android device immediately after the activity starts, worker thread's onPostExecute method is called, which is wierd because android called…
0
votes
1 answer

Android - Downloading image without knowing type?

In Android is there any way to download an image file without knowing its type ahead of time? I have this AsyncTask that downloads an image and sets it to a bitmap but I don't want to force any specific extension. Instead, I was hoping to declare a…
0
votes
1 answer

Error while executing Async Task

I m trying to get some data from a couple of web pages and saving it into a file. I'm doing all this in the AsynkTask in Android (doInBackground). When i run the app in my emulator... I get a runtime error: error occured while executing…
0
votes
2 answers

android asynchronous get foreground activity

Is there a (thread safe) method I can call from Java on Android which will give me a handle to the foreground activity from a background task? I would like to be able to do so in order to safely post toasts on top of the top window. Thanks.
Jason Posit
  • 1,323
  • 1
  • 16
  • 36
0
votes
1 answer

Confusion with background threads

I have two AsyncTasks, one is used to download xml file (DownloadTask), another is for parsing the file (ParseXMLTask). There are two cases of using this tasks: 1) File doesn't exists > execute DownloadTask, onPostExecute > ParseXMLTask 2) File…
0
votes
2 answers

Can't create handler inside thread that has not called Looper.prepare() Graphhopper

I ran into following error. logUser("An error happend while creating graph:"+ getErrorMessage()); Where getErrorMessage() is Can't create handler inside thread that has not called Looper.prepare() and logUser is a function which just show toast…
Khayam Gondal
  • 2,366
  • 2
  • 28
  • 40
0
votes
2 answers

Why does WindowClosing handler not execute Background Tasks before exiting program?

mainFrame().addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent evt) { retrieveItems(); closeAllConnections(); System.exit(0); } }); For the…
SourceVisor
  • 1,868
  • 1
  • 27
  • 43
0
votes
1 answer

Make iOS not to wait until the entire method is finished to start animation

I have a method refreshDataAction: - (void)refreshDataAction { MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; hud.labelText = @"Loading Data.Please Wait"; [self deletePreviousValues]; …
RookieAppler
  • 1,517
  • 5
  • 22
  • 58
0
votes
1 answer

Background thread and multitasking in ios?

I am a newbie to iOS. I have a requirement where I need to fetch data from a local database and upload it to a server. This has to be done in the background when the internet connection is available. How can I proceed on this? I need a kick start. I…
RockandRoll
  • 409
  • 5
  • 23
0
votes
1 answer

Managing the background thread within Android application

I currently have this class below which parses json urls and loads images and texts into a listview with the help of the Lazy Adapter Class and background thread. Each list item consists of an image view and 2 text views. I want to create pop up…
AndroidEnthusiast
  • 6,557
  • 10
  • 42
  • 56
0
votes
1 answer

Updating radio button seleciton on UI

Hi i'm trying to update the UI from a background thread. I'm setting the selection of a Radio Button programetically but strangely it wouldnt update the UI when I run the app. But when I debug the application step by step the UI updates itself which…
Mr.Noob
  • 1,005
  • 3
  • 24
  • 58
0
votes
2 answers

Speed up the response retriever from server in iphone

I am using following code to get results from server NSString *queryString = @"MyString" NSString *response = [NSString stringWithContentsOfURL:[NSURL URLWithString:queryString] encoding:NSUTF8StringEncoding error:&err]; …
Muhammad Umar
  • 11,391
  • 21
  • 91
  • 193
0
votes
1 answer

ReverseGeoCode and Save result in CoreData

Suppose i have 1000 entries for altitude and longitude in coreData. i want to do reverseGeoCoding for these altitude and longitude and save result back in coreData .Based on below concern i have decided to put reverseGeoCode operation in background…
0
votes
2 answers

Getting a hold of doInBackground(String... params)

In some way I do understand the Handler, but I'm not sure what to do with the params and how to let the code wait until the job is done in the background. I want the UI to be normally working and in the background I want to do an exchange rate…
Diego
  • 4,011
  • 10
  • 50
  • 76
1 2 3
14
15