A timer thread and url fetch thread in same activity.

by Droid » Fri, 20 May 2011 04:57:45 GMT


Sponsored Links
 I am having problems with a timer that should fetch http results from
the web every 5 minutes.
I having problems with two threads - often I cannot even turn them off
or keep the timer going without upsetting the apple cart.

Should I start using wait() and notify(), a separate service or
continue trying to get them to be friends with each other in the same
activity. At present its all very badly behaved and I feel as though I
am juggling with marbles.

-- 



Re: A timer thread and url fetch thread in same activity.

by TreKing » Fri, 20 May 2011 05:06:37 GMT


 



Just saying you're using two threads is a red flag. What apple cart?



Use a handler to schedule a message to go off in 5 minutes. When that
message is delivered, use an AsyncTask to do the fetch and handle the
results when it completes.

No raw threads necessary.

-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/treking> ; - Chicago
transit tracking app for Android-powered devices

-- 


Sponsored Links


Other Threads

1. sapa mau titip papago android?

saya ada rencana ke KL...

jika sempat mungkin saya akan ke m3shoppe, utk iseng belanja/belanja
jendela:
http://www.m3shoppe.com/index.php?page=shop.product_details&category_id=19&flypage=flypage-ask.tpl&product_id=9257&option=com_virtuemart&Itemid=26

apa sudah ada peta android papago utk indonesia?
jawab: http://navigasi.net/gofrm.php?t=42&c=FA&page=last

kotaknya kira2 kaya gini:


peta android papago kayak gini (tested):


harga lihat web m3shoppe...japri q...@gmx.com

syd
ptk

-- 
=========================
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group:

Click  

2. Test ur Net Speed!!

mana nih yg lainnya?




-- 
=========================
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group:

Click  

3. OutofMemoryError: bitmap size exceeds VM budget.....

4. CM4.2.8.1 suka reboot

5. /dev files

6. POST attempts fail every other try?

7. OpenGL: How to test for VBO support?