Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 917393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:12:17+00:00 2026-05-15T18:12:17+00:00

I have a Listener class which implements ViewListener (contains two methods, open, close, which

  • 0

I have a Listener class which implements ViewListener (contains two methods, open, close, which will fire when any monitored mailbox’s email is open/closed). So this is called from a class App extending UiApplication, and when i read a email, the open method is fired, i would like to call my original (App class) with a specific Screen (sending a message to app would be good enough). Currently i have it so that App have a static variable that stores the instance of app that’s running on the device. I used that to call a method to change screen, but it doesn’t actually bring it up. app.requestForeground() doesn’t seem to work either.

Any ideas?

Thanks a lot!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T18:12:18+00:00Added an answer on May 15, 2026 at 6:12 pm

    Have you tried using ApplicationManager to handle this? If you have a background system process listening for events, it may be possible that your GUI process isn’t even running (i.e. if you did a System.exit(0) rather than backgrounding it). Here’s a snippet of code you can use to look for the GUI process (based on its app descriptor) and either bring it to the foreground (if it’s running) or launch it (if it’s not):

    // Check if app is already running
    ApplicationDescriptor descriptor = [descriptor for your GUI entrypoint];
    ApplicationManager appManager = ApplicationManager.getApplicationManager();
    int pid = appManager.getProcessId(descriptor);
    if (pid != -1) {
        // App is running, bring it to the foreground
        appManager.requestForeground(pid);
    } else {
        // App is not running, so launch it
        try {
            appManager.runApplication(descriptor);
        } catch (ApplicationManagerException e) {
            // Can't launch
        }
    }
    

    To get the app descriptor for your GUI entry point, use the following methodology:

    1. Get the module handle using CodeModuleManager.getModuleHandleForClass(MyApp.class)
    2. Get a list of app descriptors for the handle using CodeModuleManager.getApplicationDescriptors(handle)
    3. Check the flags on each descriptor until you find one equal to “0”. This means it is not a system/auto-start/run-on-startup descriptor – probably your GUI entry point.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question about a class which implements both mouseListener and mouseMotionListener in
I want to have a class which implements an interface, which specifies the specific
I am trying to use (*env)->RegisterNatives to add methods to a defined class which
I have a public class which has the following method and instance variable: public
Consider this scenario we have a class A which is singleton it has a
I have a login.jsp page which contains a login form. Once logged in the
I have the following very simple class which looks for the last known user
I have two entites, Person and Teacher , with a OneToMany relationship: public class
Is it possible to define a spring-managed EJB3 hibernate listener? I have this definition
I have an array of FileReference objects which have several listeners attached to each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.