Android:自动弹出菜单动画
我们如何设置计时器,以便在完成图像视图动画后,弹出菜单应该自动从底部出现,而无需用户干预。
总是感谢帮助......!
这是代码
AnimationDrawable ekgframeAnimation4 =
(AnimationDrawable) ekgimgview4.getBackground();
if (ekgframeAnimation4.isRunning()) {
ekgimgview4.postDelayed(ekgframeAnimation4, 60000);
ekgframeAnimation4.stop();
findViewById(R.id.ekgimgview4).postDelayed(new Runnable()
{
public void run()
{
openOptionsMenu();
}
}, 60000);
}
else {
ekgframeAnimation4.stop();
ekgframeAnimation4.start();
ekgimgview4.postDelayed(ekgframeAnimation4, 60000);
findViewById(R.id.ekgimgview4).postDelayed(new Runnable()
{
public void run()
{
openOptionsMenu();
}
}, 60000);
}
How can we set the timer so that after completion of an Image-view animation, a pop up menu should come from bottom automatically with out the user intervention.
Help is always appreciated......!
here is the code
AnimationDrawable ekgframeAnimation4 =
(AnimationDrawable) ekgimgview4.getBackground();
if (ekgframeAnimation4.isRunning()) {
ekgimgview4.postDelayed(ekgframeAnimation4, 60000);
ekgframeAnimation4.stop();
findViewById(R.id.ekgimgview4).postDelayed(new Runnable()
{
public void run()
{
openOptionsMenu();
}
}, 60000);
}
else {
ekgframeAnimation4.stop();
ekgframeAnimation4.start();
ekgimgview4.postDelayed(ekgframeAnimation4, 60000);
findViewById(R.id.ekgimgview4).postDelayed(new Runnable()
{
public void run()
{
openOptionsMenu();
}
}, 60000);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
执行
View.postDelayed
调用,并在 Runnable 中调用openOptionsMenu
。编辑:如果你的动画持续 1000 毫秒,并且有一个 id 为
R.id.exampleview
的视图,那么类似这样的事情:应该这样做。让我知道这是否适合您。
Do a
View.postDelayed
call and in the Runnable callopenOptionsMenu
.EDIT: if your animation lasts 1000 milliseconds and there is a View with the id
R.id.exampleview
, then something like this:should do it. Let me know if that works out for you.