Custom event listener on Android app

后端 未结 4 1071
春和景丽
春和景丽 2020-11-27 09:51

I need to set up a simple event listener to refresh a ListView once in a while. The problem is I don\'t know how could I generate an event.

I know that

4条回答
  •  囚心锁ツ
    2020-11-27 10:43

    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

提交回复
热议问题