Trying to use a Timer to do run this 4 times with intervals of 10 seconds each.
Timer
I have tried stopping it with a loop, but it keeps crashing. Have tried
for(int i = 0 ;i<4 ; i++){ Runnable runnableforadd ; Handler handlerforadd ; handlerforadd = new Handler(); runnableforadd = new Runnable() { @Override public void run() { //Your Code Here handlerforadd.postDelayed(runnableforadd, 10000); } }; handlerforadd.postDelayed(runnableforadd, i); }