Questions tagged [android-timer]
70 questions
8
votes
2 answers
Android Timer Schedule
Following is the code snippet which I am using in my project to schedule a task
mTimer = new Timer();
mTimer.schedule(new TimerTask() {
@Override
public void run() {
//Do Something
}
}, interval, interval);
This works fine. I get event after…

Neji
- 6,591
- 5
- 43
- 66
4
votes
2 answers
TimerTask stops firing in Service
I need to have a Service running in Android that stores a value to database every so often. How often is based on user preferences, and also if other events have happened, which can be as often as 30 seconds or up to 30 minutes.
This is not…

lostintranslation
- 23,756
- 50
- 159
- 262
4
votes
3 answers
Delay For CountDown Timer - Android
I am making a chess clock but in it I need a delay (Like it waits 10 seconds before counting). I used a Handler for it but if the button is clicked in the 10 seconds, nothing happens. Please help! Thanks!
My code:
mHandler.postDelayed(new…

Shreshth Kharbanda
- 1,777
- 14
- 24
3
votes
1 answer
Why is a Timer on Android more accurate when a finger is touching the screen?
In Delphi 10.1 Berlin, I'm making an Android app. I created a timer like this:
fTimer := TTimer.Create(nil);
fTimer.Interval := 1;
fTimer.OnTimer := OnTimer;
fTimer.Enabled := True;
In the OnTimer event, I simply do this:
procedure…

andrey
- 191
- 8
3
votes
2 answers
Service with Timer calling another Service
I am managing data from Server to Client and Client to Server using Service. In that I am calling one Service after Login:
context.startService(new Intent(LoginActivity.this, CheckAutoSyncReceivingOrder.class));
context.startService(new…

Pratik Butani
- 60,504
- 58
- 273
- 437
2
votes
2 answers
Time value getting beyond 60 min android
getting the wrong end time value (goes beyond to 60mins)
I am working on the calendar view. When I click an empty view I need to get the start time and end time I am getting start time properly but end time is going beyond 60 minutes
Eg: 4:69pm,…
user2852617
2
votes
2 answers
Change Settings.Global.AUTO_TIME to always be 1
I want Android apps to believe that Automatic Time Zone is set to ON even though it actually is not. I read that Automatic Time Zone is detected using Settings.Global.AUTO_TIME variable, which returns value 1 if Automatic Time Zone is ON and value 0…

ayush gupta
- 607
- 1
- 6
- 14
2
votes
0 answers
How to get the timer of running application?
I need to get the timer in Application manager. I have 2 application and I need to get the time, both in the list of running applications in Settings.
Here the question arises only on the time. But I still need to get a timer application. First I…

No Name
- 741
- 8
- 18
2
votes
0 answers
How to increase time in android not device time?
On every app launch, I get time from server and store as a local string. I want that time to display in text like timer function. For example, I get server time 22:32:20, then textview display like timer(22:32:21 next 22:32:22 next 22:32:23…

krish
- 21
- 3
2
votes
2 answers
How to auto refresh data displayed in my Android Activity every second
I need to auto refresh data displayed in my Activity every second, I've used runnable, timer etc. These works perfectly but after a few seconds the UI is slow and sometimes not responsive. I've read about IntentService but I don't think it's a good…

Abhishek Purohit
- 47
- 2
- 7
2
votes
1 answer
Recycler View update few row every x sec
i have view pager . view pager have 3 section/tabs which have same fragments .fragment contains recycleview.
in recyclerview i have custom layout for row . row contain textview and imagers . for textview its timer which should update every 1 sec .…

andr
- 21
- 2
1
vote
1 answer
Catch Alarm Manager event In Android
I wonder is there any ways to catch event by BroadCast receiver in Android. Because I want to do stuffs in particular time. For instance: I want to update my room database in specific time. Please help.

bovietvidai
- 105
- 5
1
vote
0 answers
Android device wont switch on programatically
We have written a test app to try and debug a issue with a 3rd party by reproducing the issues with our own source code.
The app has a feature to allow us to set times for when the devices switches off then on. This is to comply with green power…

TenG
- 3,843
- 2
- 25
- 42
1
vote
1 answer
Compare time in Android?
I have two times opening and close. I want to generate as much slot which can be accommodate within defined range with fixed number of minutes. For e.g opening time: 12:30 pm and close timing: 3:30 pm respectively. So in this particular range i have…

Azhar Bhatti
- 91
- 1
- 3
- 14
1
vote
0 answers
Out of memory error using Volley using timers
I have this issue with Volley library requests. I make calls to API and since they have to be updated very often I implemented timers. After some time it throws me error:"Throwing OutOfMemoryError “pthread_create (1040KB stack) failed: Try again. I…

Grace
- 11
- 4