流行到主屏幕 [英] Pop to home screen

查看:140
本文介绍了流行到主屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用我最喜欢的一些画面此起彼伏,我需要流行到主屏幕的任何时间。有没有办法找出是活动画面是第一位的?或者,可能是,有什么功能,弹出根屏幕而不周期坡平至previous的人呢?

In my app I fave some screens one after another, and I need to pop to home screen any time. Is there any way to find out is active screen is the first one? Or, may be, there is any function to pop to root screen without cycle of poping to previous ones?

修改在不同的话,我需要我的应用程序去previous屏幕上点击黑莓后退按钮(这样做没有任何额外的code)和去在屏幕上,用户第一次看的时候启动这个应用程序上点击从我的用户界面主页按钮

EDIT In different words, I need my app to go to previous screen on click on blackberry "back" button (it do this without any additional code), and go to the screen, user first see when starts this application on click on "Home" button from my user interface

推荐答案

这可以帮助您任何时间,任何地点:

This helps you any time and any where:

将在启动类这种方法( StartUp.java

Write this method in startup class(StartUp.java):

public static void popupScreens()
{
    int screenCount = UiApplication.getUiApplication().getScreenCount();//Gives how many screens are active state in background;
    for (int i = 0; i < screenCount; i++) 
    {
        Screen screen = UiApplication.getUiApplication().getActiveScreen();
        UiApplication.getUiApplication().popScreen(screen);
    }
}

和调用此方法在使用类名称的任何地方(例如: StartUp.popupScreens )在任何地方然后弹出堆栈中的所有画面。

and call this method at any place with class name(EX: StartUp.popupScreens) in any where then it popup all the screens in the stack.

这篇关于流行到主屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆