Android Handler postDelayed executes twice
Posted
by
Ömer Baykal
on Stack Overflow
See other posts from Stack Overflow
or by Ömer Baykal
Published on 2011-11-28T17:47:18Z
Indexed on
2011/11/28
17:52 UTC
Read the original article
Hit count: 1047
When I use Handler and its postDelayed method, the run() method executes twice. Below is part of my code.
Handler deneme = new Handler();
deneme.postDelayed(new Runnable() {
@Override
public void run()
{
randomOyna();
}
}, 1000);
where randomOyna is the method
public void randomOyna()
{
Log.v("sonOlarak", "çalisti");
}
I monitor the LogCat and see that "çalisti" entry is written twice, so that randomOyna is called twice. The task is scheduled truely, but executes both after 1 sec and 2 secs.
Can you help me???
© Stack Overflow or respective owner