i'm tryin' to display a msg every 1 min!! non stop! i found exemple that display the msg just one time after a fixed delay!! can you help how can set it?? or if using timer is better how it works i need an exemple!!
public class TimertestActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
Handler handler = new Handler();
handler.postDelayed(
new Runnable() {
public void run() {
afficher();
}
}, 1000L);
}
public void afficher()
{
Toast.makeText(getBaseContext(),
"test",
Toast.LENGTH_SHORT).show();
}
}
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…