我只想在单击按钮后每 3 秒调用一次函数这里出了什么问题-
galleryBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
final Handler handler = new Handler();
for(int i = 0;i<3;i++){
handler.postDelayed(new Runnable() {
@Override
public void run() {
// Do something after 5s = 5000ms
viewAnimator.showNext();
}
}, 3000);
}
}
});