Questions tagged [postdelayed]

176 questions
0
votes
1 answer

How to check if binder of Butterknife is unbinded

Sometimes I got exception: kotlin.UninitializedPropertyAccessExceptionlateinit property textTv has not been initialized declaration of view: @BindView(R.id.tv) internal lateinit var textTv: RipplePulseLayout rest are classic ButterKnife…
Maher Abuthraa
  • 17,493
  • 11
  • 81
  • 103
0
votes
0 answers

SoundPool not playing audio

I set up a SoundPool for playing a sound at regular intervals but it is not playing any audio. I have tried MediaPlayer, but that eventually crashed the app, so I'd like to know if the way I'm doing it now is even a good way of doing it? I am still…
swegdawgs
  • 1
  • 1
0
votes
1 answer

Android how to show an image for a specific time in a layout and then show the content of layout

I want to know how to show an image which is in my case a gif loading screen to show when opening the layout of web view to give it time to give time to load contents in web view. Either i should use a timer for the image to load or anything…
PRAJ
  • 33
  • 7
0
votes
1 answer

Which approach is better for custom View: creating new Handler or using existing one?

Lately, I was writing a custom View in my Android app, by extending the View class. I needed some looping animation inside and I used new Handler().postDelayed(...) to set a delay between loops. One of my colleagues told me that I don't need to…
Sergey Emeliyanov
  • 5,158
  • 6
  • 29
  • 52
0
votes
0 answers

Handler postdelayed is unaffected for less than 10 milliseconds

I have created two TextViews and updating their contents through two different handlers, one for each TextView. I am incremented two counters in both handlers, one in each, and posting their values to respective TextView. My first handler is ticking…
0
votes
1 answer

how to pass argument to postDelay() inside FOR loop

I want to introduce the function postDelayed() inside my FOR loop but the compiler no longer recognizes the following variables: Jarray, i, getString() ... JSONObject result1 = new JSONObject(result); JSONArray jArray =…
user7722025
0
votes
2 answers

code to be executed every x milliseconds, changeable

I have a code to be executed every x milliseconds, where x is changeable during the app life cycle. Right now I use the postDelayed function of an handler, but I am not able to manage the situation when the delay changes. handler.postDelayed(new…
Giacomo M
  • 4,450
  • 7
  • 28
  • 57
0
votes
0 answers

How to play a tone repeatedly every 2 seconds?

My Question is about how i can play tone named beep_e.mp3 repeatedly with delay of 2 seconds.I am playing tone when i get value below 100 or above 200.So when value is i get 250 every time i want to play tone regularly but with delay of 2seconds.I…
0
votes
1 answer

How to achieve Java.Lang.IRunnable in Xamarin iOS

I want to identify the scroll end action, which could not be achieved through the existing APIs from ScrollView. Because, when we scrolled fast, event after the pointer/hand is taken, certain scrolling is took place on its own. My requirement is to…
Arun Prasad
  • 360
  • 3
  • 18
0
votes
3 answers

can not run countdowntimer at all

I have a problem with countdown timer.I try some of solutions and articles in this site but they never worked for me. so, please read my codes... also I used handler.postDelayed(new Runnable() { before and it was not my solution but it just…
nobit
  • 3
  • 5
0
votes
3 answers

Repeat delayed task n times

i want to run a portion of code n times with delay of some seconds. here is my code: Runnable runnable = new Runnable() { @Override public void run() { Log.e("myLog","Runnable()-->Run()"); // do a task…
0
votes
1 answer

postDelayed OnClickListener is not working

I am trying to implement a delay on button click, each second I need to remove one item from a list called solved_cells, the list initially has 16 items. below is what I did: solve_all.setOnClickListener(new View.OnClickListener() { …
0
votes
1 answer

Why Postdelayed is not working in the if statement

Why does the timer stop working when i put the postDelayed(this,1000); inside the if statement, just under seconds++;? There are 3 buttons (start,stop,reset) in the layout. Press Start->running=true,press stop->running=stop,press…
0
votes
1 answer

How to detect taps on a button whilst a delay caused by postDelayed Handler

I want to solve a problem that I have been trying to do so the last couple of days but I don't have that much experience and I couldn't find the solution anywhere else. Anyway, in my app I have a button in which I have implemented the…
0
votes
1 answer

Some Logical error in handler in Android

I am beginner in android. What I want: Here I am trying to achieve that sub handler should call 10 times of every second of main handler. And that main handler should continue until 20 seconds. Issue: To check that i\I have used log but its not…