0
私はGifImageButtonビューを持っています。アニメーションを開始してから、アクティビティを再開したい。アクティビティを再開する前にアニメーションを遅らせてください。
問題は、アクティビティを再開する前にアニメーションを3秒間持続させたいということです。
どうすればいいですか?
が、これは私のコードです:
myGifImageButton.setImageResource(R.drawable.animation);
Intent intent = getIntent();
finish();
if (intent != null) {
startActivity(intent);
}
私が読んで、より良い方法は、実行可能なを使用することですので、私はこれを試してみましたが、私はそれを成功しませんでした:
// start the animation
myGifImageButton.setImageResource(R.drawable.animation);
// delay the animation
mHandler = new Handler();
final Runnable r = new Runnable() {
void run() {
handler.postDelayed(this, 3000);
}
};
handler.postDelayed(r, 3000);
// restart the activity
Intent intent = getIntent();
finish();
if (intent != null) {
startActivity(intent);
}
ので、アクティビティを再開する前に、どのようにアニメーションを遅らせることができますか?
王を!ありがとう!私は今 '実行'のポイントを得た.. :) –