You can use handler into your class.
Below is my code which is working to perform delay operations:
private void cal(){
final Handler handler2 = new Handler();
Runnable runnable = new Runnable() {
int i=0;
public void run()
{
if(i==0)
{
// Enter your code here which you want run after some deley.
i++;
}
handler2.postDelayed(this, 2000);
}
};
handler2.postDelayed(runnable, 2000);
}
Call this function into your main class.
Hope it will work for you also.
Thanks