Maybe there's another way to display an image on top of my activity without calling a new activity? I'm not sure.
ダイアログを使って画像を表示することもできると思います。
I want to run an activity which displays an image of the result when a button is pressed and close it after a few seconds. So how can I do this?
CountDownTimeの例を使用します。ボタンクリックで。
mTimer = new MyTimer(timeToDisplay, interval);
mTimer.start()
サンプルコード..
class MyTimer extends CountDownTimer {
//constructor for timer class
public MyTimer(long millisInFuture, long countDownInterval) {
super(millisInFuture, countDownInterval);
}
// this method called when timer is finished
@Override
public void onFinish() {
//close activity or dismiss dialog here
}
//this method is called for every iteration of time interval
@Override
public void onTick(long millisUntilFinished) {
}
}