How to detect the Homescreen in Blackberry

Hello

I have this strict for the app. My application must run in the background and must get called on some global events. But I want the invocation to occur only if the user is on the screen of the Menu or home screen.

Could someone share how to ensure that the end user is in menu/home screen.

Best regards

Afonso

Here's a better way:

class HomeDetector {
  ApplicationManager amgr = ApplicationManager.getApplicationManager();
  ApplicationDescriptor hsad = null;

  public HomeDetector() {
    ApplicationDescriptor vis[] = amgr.getVisibleApplications();
    int i=vis.length; while (--i >= 0) {
      if (amgr.isConsoleDescriptor(vis[i]))
        hsad = vis[i];      }
    }
  public boolean isShown() {
    if (hsad != null)      return (amgr.getForegroundProcessId() == amgr.getProcessId(hsad))    return false;    }
  }

This accounts for the little likely chance that the application of Ribbon (homescreen) may have finished and restarted.

Tags: BlackBerry Developers

Similar Questions

  • How to detect the key ALT pressed in os7

    Hai,

    How to detect the key ALT pressed in Os7...

    Can I use the source for os 7 as below? ,

    protected boolean keyStatus (int keycode final, time final int) {}

    If (Keypad.key (keycode) == Keypad.KEY_ALT) {}

    ...

    Returns true;

    } else

    Return super.keyStatus (keycode, time);

    }

    and also I want to know which is the return of this method? In detail
    How to detect the other touches also?
    What are the updations or changes in the code, on os6 os7?

    KeyCode is a bit model, if you use "is" to compare you won't get accurate results, you should use the operator '& '.

    See
    http://supportforums.BlackBerry.com/T5/Java-development/detect-ALT-and-shift-key-clicks/Ta-p/444976

  • How to detect the window closing event and to do some tasks before leaving

    Hello

    Someone knows how to detect the window closing event and to do some tasks before leaving?

    Sridhar

    Structure of the event allows to detect the window closing event. In the structure of the event,.

    Select this VI-> close round table for this task. See attached picture.

  • How to detect the sign of a number?

    I output which gives the number of negative or positive. My problem is how to detect the sign of the Boolean number and output? For example if the input number is negative as - 23.11 I want to output the value false and if the number is positive as 17.99 I want to output true.

    T H A N K S!

    Test if the number is greater than or equal zero.

  • How to free the memory through BlackBerry Webworks Code

    I am faced with the question as "the available memory on your device is low. Close to some of the items below. "When I close the application of phonegap webworks after a few shots. How to free the memory through BlackBerry Webworks Code.

    It is a good number that in the face of demand for the BB webworks. Very common when you dynamically load images or by using the browser in your application. Please visit this link for details...

    http://supportforums.BlackBerry.com/T5/Web-and-WebWorks-development/device-memory-is-low-issue-for-a...

  • How to debug the java application BlackBerry on Eclipse with a BlackBerry Smartphone?

    Problem:

    How to debug the java application BlackBerry on Eclipse with a BlackBerry Smartphone?

    The following procedure:

    http://docs.BlackBerry.com/en/developers/deliverables/12002/Debug_an_app_on_BB_device_656366_11.jsp

    Error:

    An internal error occurred during: "launch WMMS_ACC_video_test0".
    java.lang.NullPointerException

    I found that other methods of debugging.

    If anyone knows how to do it please tell me.

    Thank you for your attention.

    http://www.BlackBerryForums.com/developer-forum/107455-debugging-live-device.html

    Solution:

    Start the IDE
    Connect your device to the PC via USB
    compile your application and load on the device
    in JDE - Debug - attach to-Pocket
    ignore all dialog boxes
    do the breakpoint
    Start your application on the device

  • How to disable the homescreen in first CC 2015

    How to disable the homescreen in first CC 2015

    You can disable it but it leaves you in another weird situation about opening files. That is to say it will open the last project.

    Parameters of preference if you want to do

    I have just turn it off until it loads completely and open what ever project in the file menu.

  • How to detect the number of created quickobjects

    How to detect the number of quickobjects created? quickobject are quickbox2d.

    Basically, I have a timer that will countdown to 4 seconds and it will create a falling ball, it will get removed when she falls down. However, I want only there so that if more than 5 bullets are in step, it will cease to create until it is less than 5 to start creating some balls again. Is there a way I can do?

    It's the timer to create the ball

    If (! _ballCreation_timer) {}

    _ballCreation_timer = new timer (4000);

    _ballCreation_timer.addEventListener (TimerEvent.TIMER, _onBallCreationTimer);

    }

    _ballCreation_timer. Start();

    Function which create the ball based on clock

    function _onBallCreationTimer (e:TimerEvent): void {}

    _doCreateNewBall();

    }

    function _doCreateNewBall() {}

    _ball_quickobject = sim.addCircle ({x: PHYSICS_SCALE * (960), y: PHYSICS_SCALE * (10), RADIUS: 0.5, draggable: false});

    MAKE A LIST OF BALLS

    _balls_array.push (_ball_quickobject);

    }

    This is the part where if the table (QuickObject) ball falls down and are destroyed

    addEventListener (Event.ENTER_FRAME, _onEnterFrame);

    DRAW EACH BALL FALLING OUT OF THE SCREEN

    function _onEnterFrame (aEvent: Event): void {}

    for each (var quickObject: QuickObject in _balls_array) {}

    BALL FALLING OUT OF THE SCREEN?

    If (quickObject.y / PHYSICS_SCALE > 1080) {}

    _doHandleBallOffScreen (quickObject);

    }

    }

    }

    DESTROY THE BALL FALL OFF THE SCREEN IF

    function _doHandleBallOffScreen (aQuickObject: QuickObject): void {}

    DESTROY THE OBJECT

    aQuickObject.destroy ();

    REMOVE FROM THE CUSTOM TABLE

    _balls_array.splice (_balls_array.indexOf (aQuickObject), 1);

    }

    check the length of _balls_array.  If it is greater than 5, do not create another bullet:

    If (! _ballCreation_timer) {}

    _ballCreation_timer = new timer (4000);

    _ballCreation_timer.addEventListener (IMER TimerEvent.T, _onBallCreationTimer);

    }

    _ballCreation_timer. Start();

    Function which create the ball based on clock

    function _onBallCreationTimer (e:TimerEvent): void {}

    _doCreateNewBall();

    }

    function _doCreateNewBall() {}

    If (_balls_array.length<>

    _ball_quickobject = sim.addCircle ({x: PHYSICS_SCALE * (960), y: PHYSICS_SCALE * (10), RADIUS: 0.5, draggable: false});

    MAKE A LIST OF BALLS

    _balls_array.push (_ball_quickobject);

    }

    }

    This is the part where if the table (QuickObject) ball falls down and are destroyed

    addEventListener (Event.ENTER_FRAME, _onEnterFrame);

    DRAW EACH BALL FALLING OUT OF THE SCREEN

    function _onEnterFrame (aEvent: Event): void {}

    for each (var quickObject: QuickObject in _balls_array) {}

    BALL FALLING OUT OF THE SCREEN?

    If (quickObject.y / PHYSICS_SCALE > 1080) {}

    _doHandleBallOffScreen (quickObject);

    }

    }

    }

    DESTROY THE BALL FALL OFF THE SCREEN IF

    function _doHandleBallOffScreen (aQuickObject: QuickObject): void {}

    DESTROY THE OBJECT

    aQuickObject.destroy ();

    REMOVE FROM THE CUSTOM TABLE

    _balls_array.splice (_balls_array.indexOf (aQuickObject), 1);

    }

  • How to detect the color pages in a PDF file?

    I use a plug-in of Acrobat C++ read/modify a PDF file.

    I need to get the total number of pages in the PDF file and the page numbers of the pages in color.

    So far, I was able to get the total number of pages using PDDocGetNumPages() with no problems.

    However, I can't find an API that lets me know if a particular page is color or not. Is there a way to do this?

    Thanks in advance!

    But what happens if there are RGB data which means black or grey (R == G == B), that means black or RGB?

    There is a code sample in the SDK to browse content in the PDF file, and then you can get the color space and color of each object.

    But you really need to do background research on the colors & spaces to achieve this properly.

    From: Sachintha81 [email protected]<>[email protected]>

    Reply-To: "[email protected]<>[email protected]> ' [email protected]<>[email protected]>" "

    Date: Wednesday, February 8, 2012 16:57:10-0800

    To: Leonard Rosenthol [email protected]<>[email protected]>

    Topic: How to detect the color pages in a PDF file?

    Re: How to detect the color pages in a PDF file?

    created by Sachintha81http://forums.adobe.com/people/Sachintha81> in Acrobat SDK - see the discussion complete onhttp://forums.adobe.com/message/4194889#4194889

  • How to detect the operating system to PDF using javascript

    Hello

    How to detect the operating system to PDF using javascript. (Javascript console)

    Thanks in advance.

    App.Platform will return "WIN", "MAC" or "UNIX".

  • How to detect the movement of components in PaneView event?

    Hi, there! ~

    At first please let me explain what is my development environment, I am develping apps based on BlackBerry JRE 6.0.0 by Eclipse and I'm debugging my apps on Simulator (BlackBerry 9800, 6.0.0.706) and peripheral (BlackBerry 9900, 7.1.0.912)

    I'm starting a new application which is a multifunction, during the wake I want to use a new layout UI for me, I've already imported from the code named "PaneManagerDemo" example and I built a framework in my application, I initialized TitleView as HorizontalScrollableTitleView and add titles and content.

    I also used a UI component custom named "ListStyleButtonField" come from the official web site of blackberry, once all the ListStyleButtonField of accumulated height exceeds the height of the content field, which cause the ListStyleButtonField lost her concentration and I do not know the focus was left to the last content topic whose screen slipped to finally make the time.

    My question is is it possible to detect the components slide event, I'll focus on the ListStyleButtonField what is the top of the content if I can control this event, please help me to solve this problem, thank you! ~

    I already find the method to detect the movement of the pane in PaneViewManager event, by according to this thread How to handle events of TouchGesture

  • How to detect the application is closed

    Hello

    I would like to ask how to detect closing the application? I would like to add an action (for example, backup settings and etc.) when a user closes the application. Thank you

    In the Cascades you usually want to hang a slot for the aboutToQuit() signal.

    Documentation here should lead you to everything you need to know: https://developer.blackberry.com/cascades/reference/bb__cascades__application.html#setautoexit

  • How to detect the compatibility mode on BB 9530

    Hi guys '

    My application works fine when compalibility mode is disabled on BB 9530 storm.

    But this (compalibility mode) mode is activated after the downloaded application.

    I want to detect it as compalibility mode is disabled or enabled.

    How to detect?

    Thank you guys

    You can detect if your Application is in compatibility mode or not by checking

    yourApp.isInTouchCompatibilityMode()
    

    Where "Yourapplication" is an instance of Application or UiApplication.

    You can also check your app starts in native mode by editing the file .jad, as shown in this article: http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800719/What_Is...

  • How to detect the resource (find) information?

    Hi all

    I'm trying to detect programmatically information resource name for devices HSDIO PXI and PXI-4130.   How can I do?    System DAQmx property does not include these devices, and I can't find a way to convert a resource VISA name in name of resource HSDIO or NI DC PS formats.  I enclose a code snippet that detects resource VISA for a device 6552 name, but I can't seem to figure out how to get the name of MAX the device resource.   Both the niHsdio and the properties of 'name of the resource' OR DcPS requires that you spend a session valid in them need valid resource name andI to make...

    And no, asking the operator to launch of MAX and find the name of the resource is not an option

    Thank you

    Hello

    Modular instruments and devices devices use their own set of screws to find devices in the system. The lybrary called NOR-ModInst and i's includedin the palette of the utility with the MID drivers.

    Here is a small example that demonstrates the use of their base.

    Let me know there are questions of the amy

    Kind regards

    JC

  • How to detect the number of channels on an oscilloscope?

    I have various models sitting around the laboratory, some two-channel, a few four-channel oscilloscope.  I would like for my program to be able to detect the number of channels is available.

    I can just tell my program how much string is available based on the model number, but is there a VISA command to request scope directly what channels he has?  I would also be able to ask what, if any, ability to function math there.

    "all drivers of the oscilloscope must return the instrumentID after initialization, and that should be enough to know the number of channels.

    What Albert was referring to is that all compatible drivers IVI in their base class interface have an attribute/property that indicates how many channels has the scope.

    If you don't want to use the driver of the IVI for the scope then maybe download some of the drivers and check the source code to see how they calculate this dynamic repeated capablity.

Maybe you are looking for

  • iPhone 5 still rings for number of blocked list

    I blocked several numbers of known telemarketers, for example (213) 266-7280 called me last Wednesday and I immediately went to the entry in the recent, tapped info, operated calling this block. The number is displayed as the last entry when I go int

  • Firefox screen has resized itself, and the tab bar rolled off the coast of the upper part of the screen.

    This may or may not have something to do with my installation and performance of PC Decrapifier & CCleaner on my desktop PC (I think it started happening before then today). Anyway, intermittently, the Firefox screen becomes too large to display all

  • Satellite Pro 6100 - display driver and his resulution

    HelloI need help :)i´ll instaled WinXP SP2 and 1.2 "on the right side... display dosnt work in SP1 is all ok display on SP2 driver is Plug-and-Play monitor (display resolution max is 969 x 768) in display resolution seting display on SP1 driver is To

  • not able to find the cRIO in maximum DHCP address lease ok.

    Hello I have a cRIO OR installed for the first time that I have a question, adding to the measurement and automation Express (MAX) I did the following: -i held the reset for 5 seconds button. -i got a tripple blink -check that a DHCP lease was obtain

  • Virtual DC

    I have an old Sourcefire3D virtual Center of defense that was taken out of production for several years now, but I kept in my inventory. It is 5.1 running and is not currently used, but we are looking to upgrade all the ASAs at the X models in order