views:

697

answers:

2

Hi everybody, I need to set up a simple event listener to refresh a listview from once in a while. The problem is I don't know how could I generate an event.

I know that for events like key or button pressing I just need to implement the handler. But in this specific case I actually need to generate the event, which will be fired everytime another running thread of my app wakes up and refreshes it's list of news from a rss feed.

I've done everything, but got stucked in here. Can I get any suggestion or link with some more info on how to implement this?

Thanks

Nelson R. Perez

A: 

take a look at this article: http://www.devarticles.com/c/a/Java/Listeners-in-Java/

Reflog
A: 

It sounds like you need a Handler - (look-up android.os.Handler for details).

The sendMessageDelayed method will allow you to schedule when the message is sent to your handler.

A quick search pulled up a full example that should get you started: http://www.tutorialforandroid.com/2009/01/using-handler-in-android.html

Colin Stewart