如何在销毁 J2ME MIDP 应用程序之前停止显示它?

发布于 2024-09-01 16:47:36 字数 408 浏览 1 评论 0原文

我有一个 J2ME 应用程序,用户可以选择从应用程序内拨打电话号码。这应该是用户使用应用程序执行的最后一件事,因此它应该停止显示任何内容。

我当前的代码:

public void callAndExit() {
  // use a platform-specific request to dial
  MyMidletThingummy.getInstance().platformRequest( "tel:" + number );

  notifyDestroyed();
}

呼叫工作正常,使用手机的本机呼叫方式等。问题是,在呼叫完成后(每当用户挂断电话时),我的应用程序会在被销毁之前显示一瞬间。我可以采取什么措施来停止显示 MIDlet(例如,显示手机的主屏幕或它希望显示的其他任何内容),然后拨出?

I have a J2ME application where the user has the option to dial a phone number from within the application. This should be the last thing the user does with the app, so it should stop displaying anything.

My current code:

public void callAndExit() {
  // use a platform-specific request to dial
  MyMidletThingummy.getInstance().platformRequest( "tel:" + number );

  notifyDestroyed();
}

The call works just fine, uses the phone's native way of calling, etc. The problem is that, just after the call completes (whenever the user hangs up), my application displays for a split second before being destroyed. Is there something I can do so that I stop displaying the MIDlet (and, say, show the phone's home screen or whatever else it would rather display), then dial out?

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

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

发布评论

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

评论(1

撧情箌佬 2024-09-08 16:47:36

将 MIDlet 的 Display 的当前 Displayable 设置为 null。

Set your MIDlet's Display's current Displayable to null.

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