如何判断应用程序是否在后台运行

发布于 2024-10-04 03:14:18 字数 182 浏览 2 评论 0 原文

我有一个应用程序,在单击应用程序图标时(即进入应用程序时)询问密码。然后我设置了 UiApplication.getUiApplication().requestBackground();应用程序在后台运行的地方。

现在,如果我再次进入该应用程序,则意味着它已询问密码。

帮帮我吧。

就此而言, 桑帕斯

I have an application that ask's password while clicking the application icon(ie. while entering the application). Then i have set UiApplication.getUiApplication().requestBackground(); where application is running in background.

Now if am again enter into the application means it have ask password.

Help me pl.

With regards,
Sampath

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

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

发布评论

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

评论(2

家住魔仙堡 2024-10-11 03:14:18

您可以使用 UiApplication.getUiApplication().isForeground() 方法来确定您的应用程序是否位于前台。

isForeground 方法继承自 net.rim.device.api.system Application 类,该类还支持 requestForeground 和 requestBackground 方法。

http://www.blackberry .com/developers/docs/4.6.0api/net/rim/device/api/ui/UiApplication.html

You can use UiApplication.getUiApplication().isForeground() method to determine if your application is in the foreground.

The isForeground method is inherited from net.rim.device.api.system Application class which also supports requestForeground and requestBackground methods.

http://www.blackberry.com/developers/docs/4.6.0api/net/rim/device/api/ui/UiApplication.html

靖瑶 2024-10-11 03:14:18

我想您可能对 Application.activate() 方法:

public void activate()

// Handles foregrounding event.

// The system invokes this method when it brings this application 
// to the foreground. By default, this method does nothing. 
// Override this method to perform additional processing 
// when being brought to the foreground.

UiApplication 扩展了 Application,因此此方法也可在您的 UiApplication 中使用代码>子类。

I think you may be interested in the Application.activate() method:

public void activate()

// Handles foregrounding event.

// The system invokes this method when it brings this application 
// to the foreground. By default, this method does nothing. 
// Override this method to perform additional processing 
// when being brought to the foreground.

The UiApplication extends Application so this method is also available in your UiApplication subclass.

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