如何使用没有按钮的对话框并自动关闭?在黑莓手机上

发布于 2024-10-05 21:19:46 字数 57 浏览 0 评论 0原文

我需要使用一个对话框。出现 2-3 秒后自动关闭。 我应该在 BlackBerry 上使用哪个对象?

I need to use a dialog. That appears 2-3 seconds and after closes automatically.
Which object should I use On BlackBerry?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏有森光若流苏 2024-10-12 21:19:46

你也可以使用

Status.show(String message) 

显示状态屏幕两秒钟。

或者

Status.show(String message, Bitmap bitmap, int time) 

显示指定的状态屏幕
图标,指定时间。

you can also use

Status.show(String message) 

Shows a status screen for two seconds.

or

Status.show(String message, Bitmap bitmap, int time) 

Shows a status screen with specified
icon, for specified time.

缱绻入梦 2024-10-12 21:19:46

创建一个扩展 PopupScreen 的类并使用 TimerTask 自动关闭它。所以你的构造函数中的代码看起来有点像这样:

    Timer timer = new Timer();
    timer.schedule(new TimerTask(){

        public void run()
        {
            if(TestScreen.this.isDisplayed())
            {
                synchronized (Application.getEventLock())
                {
                    TestScreen.this.close();
                }
            }
        }

    }, WAIT_TIME_IN_MILLISECONDS);

Create a class that extends PopupScreen and use a TimerTask to automatically close it. So you would have code in your constructor that looks sort of like this:

    Timer timer = new Timer();
    timer.schedule(new TimerTask(){

        public void run()
        {
            if(TestScreen.this.isDisplayed())
            {
                synchronized (Application.getEventLock())
                {
                    TestScreen.this.close();
                }
            }
        }

    }, WAIT_TIME_IN_MILLISECONDS);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文