Since no code has been placed for us to analyze, follow a generic model so you can quickly adapt your reality:
import android.os.Bundle;
import android.os.Handler;
public class MinhaClasse extends AppCompatActivity implements Runnable{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tela_minha_tela);
//insira o código aqui que será execultado antes dos 5 segundos
Handler handler = new Handler(); //classe para contagem de tempo
handler.postDelayed(this, 5000); //5000 = 5 segundos
}
@Override
public void run() {
//Aqui ficará o código que será executado após 5 segundos
}
}
Could you show us the relevant part of your code so far? This facilitates our analysis and increases the possibility of you getting help. See here
– Felipe Augusto