Save the PhoneListener and the FolderListener in a single application

If I'm around all blackberry applications, when I get a phone call, I'm able to display a popup once the call is answered for example. But if I get an email, I'm not able to display any popup screen, even if I see the messagesAdded() get me fired and also the popupscreen is invoked as I reinforced with debugging.

The mechanism that I use to view the popuscreen phone and Email is the same, but the event of phone works and not the event of enamel.

Here is what I do

AutoStart calls my main class

public final class myMain {}
       
{private myMain()
try {}
Phone.addPhoneListener (new ConcretePhoneListener());
Store is Session.waitForDefaultSession () .getStore ();.
store.addFolderListener (new ConcreteEmailListener());
}
catch (Exception e) {}
//
}
}
   
Public Shared Sub main (String [] args) {}
PAP PimAssistantMain = new PimAssistantMain();
}
}

In my ConcretePhoneListener(), this is how I invoke the popup screen

SerializableAttribute public class ConcretePhoneListener extends AbstractPhoneListener {}
   
private void somePrivateMethod() {}

UiApplication.getUiApplication () .invokeLater (new Runnable() {}
public void run() {}

UiApplication.getUiApplication () .pushScreen (new PhonePopupScreen());

}
});

}

}

the code above works, but

/ public class ConcreteEmailListener implements FolderListener {}
   
private void somePrivateMethod() {}

UiApplication.getUiApplication () .invokeLater (new Runnable() {}

public void run() {}

UiApplication.getUiApplication () .pushScreen (new EmailPopupScreen());

}

});

}

}

the above code IS NOT working for some reason any in the sense that, when new email arrives, I don't see the screen like the one for the phone, the event popup not.

In the EmailPopupScreen() and PhonePopupScreen(), I would go the PopupScreen and make sure that the screen is in the foreground by using the code below

protected void onObscured() {}
UiApplication.getUiApplication () .requestForeground ();
}

Can someone tell me first if I'm heading in the right direction and also explain this strange difference in the behavior for these 2 types of events and how the email event a popup screen

First off let me say that I have NOT actually tried a screen on an email listener, so this might not work, but I might be able to help.

First of all, to look for a couple of things

UiApplication.getUiApplication ()...

Do not forget that this gets a reference to the UiApplication who is running, not your application.  So if you run in the earpiece of the phone you are running in the phone, in the listener of e-mail application, you run in the messaging application.

protected void onObscured() {}
UiApplication.getUiApplication () .requestForeground ();
}

onObscured is called when the screen is covered by another screen.  If she does not, she will not be called.  Assume its display, the screen masking came from the same application which displays on the screen, then the requestForeground() will not do anything, because the Application is always in the foreground.  If the screen masking done from another application, then it is possible that this would actually hide the new screen.  I think that's why do you afterwards.

These points side lets talk about why it works for the phone and not by e-mail.  Easy, I think.  The earpiece of the phone runs in the phone application, which of course is in the foreground when the phone is used.  That means the app phone is to put in the background when it finishes.  So if you press a screen in the foreground when executing the application phone will display, it could disappear - that's why I think that the use of the requestForeground() in the onObscured().

However, the messaging application works in the background at the time of the invocation of the listener. Thus, while pushing the screen won't get on the screen.  So to get this screen, the application must be on the foreground.

I hope that a shed.

Now, I would say, rather than push these screens using the actual RIM applications, skip this treatment to your own application, and then you have the control over the treatment of foreground/background.  Probably the best way to proceed is to use a Global event, extract the data you want the listener, talk to your application, and then deal with this in your own application.

Edit: My apologies for this suggestion of duplication - I just changed when RexDoug

Tags: BlackBerry Developers

Similar Questions

  • Can I change the license for a single Application for all Applications?

    In December 2014, I bought a license for Adobe Illustrator? However, it seems, I also need less inDesign and Photoshop, is it possible to switch to continue the license but applications instead of buying a single license for each program?

    Please contact our phone/Chat for the same support: contact customer service

    *Remember to stay signed with your Adobe ID ( email id used to purchase the subscription ) before accessing the link above*.

    Select the exact options listed below for support options:

    Let us know if that helps.

    Kind regards

    BANI

  • Photo and video capture in a single application QML

    Hello everyone

    Currently, I am learning to use the camera QML, and I already get to open the camera back, put a few cameraSettings and take a picture.

    Now, I would like to add functions of video to this same application. I mean, I want to add a photo/video toggle button and switch between photo and video modes. The thing is that I do not know how. I guess I need a second part of the camera, but the truth I have no idea how can I achieve this goal.

    I really appreciate your help and I hope you to let me know which is the approach you have taken to do what I want to do. All link tutorial or documentation is also wellcome

    Thanks in advance guys!

    BestCamera is to show you how to use the C cascading camera API, since it allows you to do some things (such as face detection and burst capture) which are not available in API waterfalls photo.

    You need not two objects from camera to switch between the modes of capture, just change the mode of the camera.

    One thing that fires people upwards sometimes is the fact you need approval from microphone to record video, that you need not simple images.

  • HFM as a Source and a target in a single application of FDM

    Y at - it an adapter for FDM 9.3.1 that enables FDM to connect to HFM as a source and a target? What I want to do is to create an automated process to extract data from an application of HFM, re - map these data and load it into a second HFM application.

    Hello

    Unfortunately it is not. FDM views HFM/Essbase/Planning/Enterprise as target systems only.
    There might be a way to do it through scripts / api... but nothing out of the box.

    Thank you

  • How to save the State of a flash cs5 to iphone app

    Hello

    I was wondering if anyone could tell me if it is possible to somehow save the State of a flash application is able to pick up where he was arrested after being closed. For example, is it possible for a user to save games in an iPhone game written in Flash? If Yes, could someone point me in the right direction on the place where to read on how to do it.

    see you soon

    Brendan

    http://www.Adobe.com/devnet/flash/articles/saving_state_air_apps.html

  • I know not how to save and attachment to my Icoud player, but how to save the body of an email?

    I don't know how to save an attachment to an e-mail to Icloud drive but how do I save the body of an email to ICloud?

    Save it to the place where? For what purpose? As long as you do not remove it, it should remain in your email. You can move it to a folder by tapping on the icon of the folder at the bottom of the screen as you watch the email. You may also copy and paste Notes, take only a screenshot that would be in your Photos. You could transfer to a remark like Evernote service.

  • Is it possible to save the current tabs and groups so that they can be recharged at any time?

    My Firefox crashes sometimes, and when I start it up again, my groups and tabs that I had are lost, so I need to recreate my history window. Is there a way I can save the groups that I have with the tabs on the inside so that I can retrieve them at a later date.
    "I say that Firefox does not save the whenever I close the browser, so I'm güssing there a file somewhere that contains this information, if I know how is called this file I could save it on my regular schedule and retrieve them if I had to, of course the best solution would be to have a ' save the groups ' & 'Support groups' in the menu.

    Thanks in advance
    DayoJ

    (PIN) App tabs and groups of tabs (Panorama) are stored in session data in the sessionstore.js file in the Firefox profile folder.

    You can use this button to go to the Firefox profile folder currently in use:

  • I need to reinstall my Linux Mint, therfore also Thunderbird. How can I save the addresses and all my messages (copy and again after installation Thunderbird)

    I need to reinstall my Linux Mint 17 companion, therfore also Thunderbird. How can I save the addresses and all my messages (copy and again after Thunderbird installation)?

    You will need to backup your Thunderbird profile.
    _ http://KB.mozillazine.org/Thunderbird: _FAQs_:_Backing_Up_and_Restoring #Manually_back_up_the_profile

  • Why firefox does not save some username and passwords and names of other not - especially for the same website?

    I use several different accounts LogMeIn, each with their own username and password. Is there a month, Firefox stopped asking to save the user name and password for the new accounts I have access. I even deleted all accounts and began more - most of the time I will ask you to save the information of connection but other LogMeIn accounts that I access Firefox will not be asked to save the passwords. You can provide any help will be greatly appreciated.

    I had this taken care. After removing all the old names of login and passwords, you must restart Firefox with a hot start.

  • How to stop Firefox playing mp3 files and allow me to save the file

    I've upgraded to Firefox v28. I want to record an mp3 file to play later as earlier versions of Firefox. When I click on the file, it starts playing and does not give me the option to save the file.
    In the Options, the settings of 'application' for the file MP3 is on "save file". The quicktime plugin is disabled.
    The media.windows - media - foundation.enabled is set to false in: config
    How can I restore Firefox behavior to be like the older versions
    Thank you

    That fixed it! Thank you!

  • Firefox and Palemoon does not save the settings of a Web site.

    He is a recent problem. I use Firefox 25.0.1 because progress of download in Firefox 26 changes are unacceptable.

    I use www.nzbindex.nl a lot - Out of the blue Firefox will not save the settings, but will Google Chrome. In my view, that the problem is a Java problem. Any advice would be appreciated.

    This can be caused by corrupted cookies or cookies are blocked (check the permissions on the subject: permissions page).

    You can control and manage permissions for the domain in the tab currently selected through these steps:

    • Click on "Site Identity" (globe/lock) in the address bar
    • Click on 'More information' to open ' tools > Page Info "with the Security tab is selected
    • Go to the permissions tab (Tools > Page Info > permissions) to check the permissions for the domain in the currently selected tab

    Clear the cache and cookies only from Web sites that are causing problems.

    "Clear the Cache":

    • Firefox/tools > Options > advanced > network > content caching Web: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Firefox/tools > Options > privacy > Cookies: "show the Cookies".

    It is not advisable to continue to use older versions of Firefox with disclosed security vulnerabilities.

  • Password changed on a Safari but Yahoo Mail account, I cannot save the new password and username.

    Yesterday, I changed my password to a Yahoo Mail account but Safari on iMac OSX 10.7.5, (6.1.6) won't let me save the new password.  Now, I have to type my username and then auto Safari fills the old password.  I can access my emails by typing the correct password, but I can't find a way to update Safari to remember the new password or user name.  I had a look on some forums and followed the advice given there, but none of them have worked:-check that the username box and password is checked; Delete the entry in the preferences of Safari; Check the drive in disk utility and click on repair disk permissions. Click on "Repair" in S.o.s. keychain and add the password etc in the keychain.  Remove all data from the Web site and clear the history.  Switch off and unplug before returning.  Can anyone help, please.

    Hello...

    You must remove the old keychain.

    Open Keychain Access located in Applications > utilities

    Then select passwords on the left.

    Type the name of your e-mail account Yahoo in search field top right of Keychain Access window.

    Then right or control click the keychain, and then click Remove.

    Now on Safari, go to Yahoo, sign in with your user name and password. You should be prompted to save the data in a new keychain. The next time you visit this site, Safari should automatically fill your login for you.

  • How to save a password changed in Firefox? I rescued him, but then I changed the password and it doesn't give me an option to save the new password. Help, please. Thank you!

    How to save a password changed in Firefox? I rescued him, but then I changed the password and it doesn't give me an option to save the new password. Help, please. Thank you!

    The Web site may use autocomplete = off to prevent Firefox to record the name and the password.

    You can remove autocomplete = off with a bookmarklet to register the name and the password of Firefox.

  • Hi, I answered no to the question on the registration of password for a spesific site. I changed my mind and would like Firefox to save the password. How to re-enable password for a spesific site saver?

    Hi, I answered no to the question on the registration of password for a spesific site. I changed my mind and would like Firefox to save the password. How to re-enable password for a spesific site saver?

    Check the list of exceptions to your Firefox password manager and check if your site is there or not?

  • When downloading using firefox I should save the download, and then must go to the download file to start the download. When I download using internet explore I can run a download at the time where as it is downloaded. Can I change a setting somewhere?

    I use Windows 7 with firefox as my default browser. When I download a program using firefox, I wonder if I want to save the file, and then must go to the download folder to start the download. When I download using internet explorer, I gives me the ability to run the download at the time where it is downloaded instead of save the download. Is there a setting I can change to allow me to run downloads when using firefox instead of record?

    Hi shortwedge3,

    You can use the OpenDownload2 extension for the run option when downloading files with Firefox

Maybe you are looking for