views:

18

answers:

0

I have a slightly strange thing happening in my code atm, which I don't understand... I would much appreciate any input anyone may have.

So here's the issue: In my main Activity I fire a Service, using an Intent, when a button is pressed on screen. The Service instantiates 22 Runnable objects each of which read data constantly from 22 separate flat files. The data is fed into a matrix of objects (64 x 64). In my main Activity I have another button which starts a new Activity to visualises the data in the matrix. So when I press it it accesses the data stored in the objects at the same time as the 22 threads are feeding data into them. It is my understanding this kind of operation is the main reason to use threads! However, when I start the new activity it seams to interrupt and/or kill the threads as they no longer print their Log.d messages to logcat...

Is it a case that I need to bind my Activity to my Service to access data that it is processing or are the thread independent of the Service as my common sense would tell me??!

Thanks in advance for any advice!