Try the below
m_Handler = new Handler();
mRunnable = new Runnable(){
@Override
public void run() {
if(count == 0){
// do something
count = 1;
}
else if (count==1){
// do something
count = 0;
}
m_Handler.postDelayed(mRunnable, 3000);// move this inside the run method
}
};
mRunnable.run(); // missing
Also check this