Questions tagged [postdelayed]
176 questions
0
votes
0 answers
Android Best practice for background task
I have custom hardware, with a custom Android Launcher app running. I need to read an ADC chip (ADS7871) at a set interval.
Currently this is being done using a handler, but it seems the postdelayed value is not maintained if other tasks are…

Nigel Evans
- 13
- 4
0
votes
0 answers
dynamic timeout for postDelayed method in android
I am showing a wallpaper when the application starts and after a timeout second activity starts. I am using below code for this.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
…

Manmohan Jangid
- 51
- 5
0
votes
0 answers
Android How to Exit a Runnable Loop with postDelayed
I am having a problem trying to loop a runnable with a delay. I basically want to change the background of a sequence of 8 textviews with a second of interval in between each changes. The code below works fine but I can't seem to exit the runnable,…

Unkraut
- 29
- 3
0
votes
1 answer
error on handler.postDelayed (new Runnable () {
I am a novice programmer on android studio, I want to know why does the
delay function does an error on handler.postDelayed (new Runnable(){ do I have to import any library? and what is the shortcut key for :@override..." whenever I does a code.…

Andy cacho
- 1
- 1
0
votes
2 answers
Android Timer delay and reset
I'm sure there is a similar question somewhere on here but I just can't seem to find it.
Here's what I'm trying to do.
let's say I am connected to a server and I want to disconnect from it if no calls are made by the user in last 5 minutes. BUT, if…

ᴛʜᴇᴘᴀᴛᴇʟ
- 4,466
- 5
- 39
- 73
0
votes
0 answers
android handler delay for loop
I'd like to use handler.postDelayed instead of Thread.sleep() in a loop. Basically I have a sequence of numbers in a string and for each number I need a different delay to do an specific action.
hThread = new HandlerThread("HandlerThread");
…

Ioannis Panteleakis
- 58
- 1
- 7
0
votes
2 answers
Handler postdelayed is not fired after given delay interval when quitting the app in android?
Code Snippet:
Handler handler= new Handler();
handler.postDelayed(networkRunnable,
10000);
/**
* A runnable will be called after the 10 second interval
*/
Runnable networkRunnable= new Runnable() {
@Override
public void…

M Vignesh
- 1,586
- 2
- 18
- 55
0
votes
1 answer
handler.postDelayed application stopped working
my application always crash whenever it reach Toast(parent) part. i tried emptying the entire run() and there were no problem.
this codes work fine in emulator but not on device.
please ignore the Toast if you would like to, my main problem is not…

Yoh Hendry
- 417
- 6
- 15
0
votes
1 answer
How to make postDelayed work as intended?
So here is the method I found in most tutorials of SwipeRefreshLayout but it seems complitely stupid to me.
What it does : it does the refresh animation for 2000 ms before actually doStuff().
What I (obviously!!) want to do : refresh animation while…

Waroulolz
- 297
- 9
- 23
0
votes
2 answers
How to delay an action inside a for loop before continuing the next loop over again
Hi I am new in android programming. My problem is I want to make a delay before continuing the next loop over and over again depending on the size of my Array so that the sounds will not overlap.
Here is my code:
protected void managerOfSound() {
…

ALD
- 23
- 2
- 11
0
votes
2 answers
Handler postDelayed only executes 1 once inside a loop
I'm new in android programming. I have a problem in postDelayed wherein the delay only execute once inside a loop even if the value that I want to call is more than 1.
here is my code
protected void managerOfSound() {
int size = tempq.size();
…

ALD
- 23
- 2
- 11
0
votes
1 answer
Handler.postDelayed running for extra time
I am writing an handler to run for an fix amount(30 Sec) time. Basic on that it update counter to draw a view component.
counterRunnable = new Runnable() {
int currV = 0;
public void run(){
if(count >= 360)…

CoDe
- 11,056
- 14
- 90
- 197
0
votes
1 answer
View recycling in listview causes postDelayed() issue
I have a list of user tasks/to-dos which have deadlines associated with it. Every minute on the minute I update the TextView that shows the time remaining for these task.
The problem I have is that some times when the textview gets updated the wrong…

SigmaFive
- 13
- 1
- 4
0
votes
1 answer
webView scrollTo not working all the time
I am currently having a problem with Android webview scrollTo function. I have it working properly (sometimes), but as I am clicking on the links in webview, it sometimes resets the screen back to 0,0 position.
Heres my code.
public void…

shader2199
- 25
- 6
0
votes
1 answer
How to keep the scheduled handler post delayed timer task is available once the app quits inside of Alarm Receiver on-receive Method?
I have used 20 seconds Handler Post Delayed Timer task inside Alarm Receiver on-receive Method. The app is working fine if i quit the app before the alarm receiver on-receive method gets called. If I quit the app once the Handler Post delayed Timer…

M Vignesh
- 1,586
- 2
- 18
- 55