Im developing an Android app, and I need to periodically (a few times per second) execute some code from the UI thread, the Activity class.
I have seen similar problems like here Android repetitive task but what I need is to set my Activity as a listener and somehow listen to a timer, so that every X milliseconds the activity executes a method.
Something like this:
class myActivity extends Activity{
//things
//This method must be called every X milliseconds
private repetitive_method(){
....
}
//more things
}
Is there some recomended way to do this?
Your answer is there:
http://developer.android.com/resources/articles/timed-ui-updates.html