Global Timer in android

后端 未结 5 963
日久生厌
日久生厌 2021-01-21 13:40

I want to make a timer which will be shown on every activity of my application.

I know how to make a timer on an activity below is my code

public class T         


        
5条回答
  •  长情又很酷
    2021-01-21 13:54

    Create a Singleton! http://en.wikipedia.org/wiki/Singleton_pattern

    singleton guarantee that there will be only one object of some kind and makes it easy for any other object to access it.

提交回复
热议问题