Questions tagged [postdelayed]

176 questions
0
votes
1 answer

PostDelayed function going faster and faster

So I have a snake app were I'm trying to make it so that it waits for on screen touch before a new run. And I figured best way would have the code stop updating the snake and continue the UI update. So i have a game state that is running and one…
0
votes
2 answers

Show and remove an image for some seconds

I need to show an image for 1 second, at the end of that time make it invisible for 1 second, and at the end of the time again to show again, because I walk a list and no longer it displays me the following pictures. But my code only shows me the…
Exbaby
  • 75
  • 1
  • 2
  • 10
0
votes
0 answers

Android : Does handler postdelay method execute with updated private variable?

I would like to ask a general post Delay question. So I'm using this method in my app, but it seems it is not working as I have expected. What I'm trying to check is say : private boolean privateVariable = false // private instance field new…
joony0123
  • 41
  • 8
0
votes
2 answers

Handler not working as planned

try { //got input from asset that's not a problem JSONObject obj = new JSONObject(loadJSONFromAsset()); JSONArray m_jArry1 = obj.getJSONArray("check"); int j=0,i,k=0; …
0
votes
1 answer

Android multiple posts with delay

I have a set of instructions that needs to be executed repeatedly. The repeat delay is variable (the delay is taken from a file). The repeat time must be very precise (milliseconds precision). I have tried to use a Handler with postDelayed but the…
0
votes
1 answer

delay animation before restarting the activity

I've a GifImageButton view. I want to start its animation and then restart the activity. The problem is that I want the animation to last 3 seconds before restarting the activity. How can I do it? this is my…
Maor Cohen
  • 936
  • 2
  • 18
  • 33
0
votes
1 answer

sorting out different handlers android

all, i want to create multiple handlers that gets triggered based on users selection, but this handlers implement the same runnable method. the only difference is that they call different postDelayed() method. how do i go about achieving this…
irobotxx
  • 5,963
  • 11
  • 62
  • 91
0
votes
1 answer

an issue with handler.postDelayed() method

i'm using handler.postDelayed() method to repeat a task with time delay .. this is my code ; final Handler handler = new Handler(); handler.postDelayed(new Runnable() { @TargetApi(Build.VERSION_CODES.LOLLIPOP) public…
Neo Algeria
  • 235
  • 2
  • 3
  • 13
0
votes
0 answers

android AudioRecord and AudioTrack to record live audio and play back after a certain amount of time?

I want to record live audio and play back to the speaker after a certain amount of time i specified. recordAndPlayAfter(2000); example.. if i call the function it will record the audio and stream it to speaker with a 2000 millisecond delay. If i…
arifcse10
  • 133
  • 2
  • 3
  • 12
0
votes
1 answer

Achieve View.PostDelayed in Android Annotations

How to do View.PostDelayed in android annotation , is it same as @Background(delay = 1000) ?
Zulqurnain Jutt
  • 1,083
  • 3
  • 15
  • 41
0
votes
1 answer

Using postDelayed for Sensor Data

I have a working app that I need adjusted. I am trying to get the label to update every 'n' seconds using the postDelayed method but I am only getting it to delay the time in which it first shows versus updating the label every so often. I have…
Chris Panella
  • 202
  • 1
  • 9
0
votes
2 answers

android rerun handler postdelayed

I am trying to create a textview that changes content four times (replacing it each time in a series) using postdelayed handler that would stop at the end and replay the same sequence after a click of a button. For some reason I could not…
visibility
  • 23
  • 4
0
votes
1 answer

Softkeyboard hide call not working as expected in view.post(), but works fine inside runOnUIThread()

When I make a call(from inside of a fragment) to hide the keyboard inside runOnUiThread() , the keyboard hides, but when I do the same from inside of activity.getCurrentFocus().post(), the keyboard does not hide. 1) Below code…
0
votes
1 answer

Android: How views' postDelayed(runnable, milliSeconds) works with recursive runnable?

Ok, I have got following code from https://github.com/hongyangAndroid/Android-CircleMenu . Here, from print trace, I came to find that constructor is only invoked once, whereas run() method is recursively called till some condition. My question…
Binod Lama
  • 226
  • 5
  • 24
0
votes
0 answers

In Android, aborting an AsyncTask from a postDelayed runnable

In Main UI: Create a dialog without a cancel button Start AsyncTask which in turn starts a HttpURLConnection in the doInBackground() After about 10 seconds the following is started in the Main UI thread via a postDelayed Runnable Check if the…
Daniel F
  • 13,684
  • 11
  • 87
  • 116