How can I do to if a menu item exists, doesn´t repeat menuItem when I install another version of the app?

Hello

I m developing an application printing email and I want to put a menu item in the emails with the option 'print with... '. ». I use this:

PrintByMenuItem myMenuitem = new PrintByMenuItem (0);

ApplicationMenuItemRepository.getInstance (.addMenuItem (ApplicationMenuItemRepository.MENUITEM_EMAIL_VIEW),
myMenuitem, ApplicationDescriptor.currentApplicationDescriptor ());
ApplicationMenuItemRepository.getInstance (.addMenuItem (ApplicationMenuItemRepository.MENUITEM_EMAIL_EDIT),
myMenuitem, ApplicationDescriptor.currentApplicationDescriptor ());
ApplicationMenuItemRepository.getInstance (.addMenuItem)
ApplicationMenuItemRepository.MENUITEM_MESSAGE_LIST, myMenuitem, ApplicationDescriptor.currentApplicationDescriptor ());

My application has two versions, with ads or no ads. When the user to install the first version and then they want to install the second version, the application will overwrite and will be only one application in the device.

The problem is that when I install the second version, the menu item 'print with... '. ' appears twice. How can I do to if a menu item exist in enamel, doesn´t repeat the menuItem?

I ve tried using removeMenuItem before adding the menu item with:

ApplicationMenuItemRepository.getInstance (.removeMenuItem)
ApplicationMenuItemRepository.MENUITEM_EMAIL_VIEW, myMenuitem);
ApplicationMenuItemRepository.getInstance (.removeMenuItem)
ApplicationMenuItemRepository.MENUITEM_EMAIL_EDIT, myMenuitem);
ApplicationMenuItemRepository.getInstance (.removeMenuItem)
ApplicationMenuItemRepository.MENUITEM_MESSAGE_LIST, myMenuitem);

But doesn´t works.

Thank you.

This is not how it would work production / the device. After restarting the device, the menu item will be deleted from the repository, and you will have a menu item.

However, if you leave your app and try again (if you save the menu items at the application startup) the you'll thus duplication. If this isn't the case, then you should not worry.

If this is the case, then I suggest your store a veriable TERM as a check to ensure no duplicates.

Tags: BlackBerry Developers

Similar Questions

  • How can I use a selection of menu items drop down to change another field value?

    Hi guys! I work in a medical care center and I need to create a PDF file that must contain certain fields in the form. I managed to create the largest part of these areas, but I'm stuck in a menu drop-down. The drop down menu contains the names of 83 employees. Each employee has a unique code of 6 numbers. I wish these codes to appear automatically in another field based on the selection of a brand in the drop-down menu field. Is there a way to do this without scripts? I'm not a programmer and have no programming capabilities. I work in Adobe Acrobat Pro DC!

    Forms.jpg

    You can do this by using a very simple script.

    Basically what you need to do is define the export value of each item in your drop-down menu for the corresponding code to this person and then use this code as the custom text field calculation script (replace 'Employee' in the code with the actual field name, of course):

    Event.Value = this.getField("Employee").valueAsString;

    PS. You must also enable the option validate the selected value immediately in the drop-down list field. You'll find it under properties, Options tab.

  • How can I contact Apple on their impression of being too light and too small for me to read on the App Store?

    Dear Apple Inc.:

    Could Apple or someone please re - write, or send me this Web page on Apple Apps again in a larger type darker so I can read it?  I wrote my full address, e-mail address, telephone number and hours when I'm usually home at the bottom of a page and tried to send it to Apple, but don't really know where to send it as apple.com/feedback/ doesn't seem to work.  I'm an old doctor with a vision 20/20 to the left eye and vision of 20/40 in the right eye.  I bought Apple hardware and software for an amount over $30 000,00 since I started in 1986, and possessed a large number of shares of Apple since 1984.  Many of the biggest private to Apple hardware and software purchases comes from older people like me.  There is no reason that Apple cannot leave us the possibility to make the type larger and darker.

    There are millions of us who need larger type darker than updates and others on the App Store.

    Option/⌘ + / = (is Option/command/Equals if not print) won't the darker type.  Although it gets bigger, it causes aliasing (anti-aliasing).

    We are all end users here like you

    You can give your comments to http://www.apple.com/feedback

  • I can another install another version of the Oracle database on the same operating system

    Hello

    I installed Oracle 10 g Express edition on windows xp laptop data. Can I install another another version - Oracle 9i or Oracle database 11g on the same operating system.

    Please advice.

    Thank you.

    I installed Oracle 10 g Express edition on windows xp laptop data. Can I install another another version - Oracle 9i or Oracle database 11g on the same operating system.

    On XP virtual machine (a criterion), which I normally attribute 800 M Ram, I installed 8i, 9i, 10g, 11g and database XE and same server forms & States and Developer suite.

    All work at the same time, of course.

  • Can I download and install older versions of the apps?

    My computer is very old, it does not support the operating system that is necessary to support new applications. I need to download Lightroom 4. Can I do this through creative cloud?

    Yes.

    Open the application of cc desktop > apps > find additional applications > previous versions > lr install > 4.4

  • I installed a game on the App store and now I can't find how to open it to read.

    Original title: App Store

    I am new to Windows 8. I installed a game on the App store and now I can't find how to open it to read. Help is appreciated with kindness. Thank you.

    Hello

    Usually, apps in the Windows store are pinned at the end of the Start Menu.
    You can search the game:
    Windows key + Q (This will open the Find tab in the start menu)
    Type the name of the game in the Search box.
    Pin it to Start is not to lose in the future.
  • I would like to ask how can I do a massage of automatic return, I'm currently not available when vecation, travel bussines... Thank you

    I would like to ask how can I do a massage of automatic return, I'm currently not available when vecation, travel bussines... Thank you

    If this fix your problem, please mark the thread as "solved" Please?
    Thank you.

  • How can I remove a "do not disturb" sign for a specific contact? Their messages will not appear on the screen of my phone when it is locked

    How can I remove a "do not disturb" sign for a specific contact? Their messages will not appear on the screen of my phone when it is locked

    kochetova01 wrote:

    How can I remove a "do not disturb" sign for a specific contact? Their messages will not appear on the screen of my phone when it is locked

    Go to the message - details - do not disturb - off

  • The standard weather app on my iphone 6 has stopped working.  It shows just my wallpaper grayed out when I try to access.  The app can be restarted or deleted and reloaded?  If so, how?

    The standard weather app on my iphone 6 has stopped working.  It shows just my wallpaper grayed out when I try to access.  The app can be restarted or deleted and reloaded?  If so, how?

    No, the soft part of the operating system, so it would mean reload the iOS together. Have you tried a forced reboot yet?

    Close all open applications by double-clicking the home button, and then drag to the top of the application window until it disappears from the screen.

    Reset your device: press and hold the home button and the sleep/wake button until the screen goes black, and you see the Apple, then let go. (No data loss)

  • How can I get a name of table 1, column A, if column B is a negative number and insert the names of table 2?

    How can I get a name of table 1, column A, if column B is a negative number and insert the names of table 2?

    What is the formula?

    You can do this with a column of "index" in table 1, as this assistance:

    The formula in C2, filled to the bottom:

    IF (B =<>

    That increments a counter each time that it finds a negative number in column B.

    In the second table, you can retrieve a list of negative values in this way:

    The formula in A2, filled to the bottom:

    = INDEX (array 1::A, CORRESPONDENCE (LINE (−1, Table 1::C), 0))

    It takes the line number, the formula is activated, subtracts 1 to the header line and look up the result in the column of table 1 C.  If it finds a match, it feeds the line number to the INDEX page with retrieves the value of the column of table 1A.

    To hide the red triangles of signage wrap the IFERROR formula, like this:

    = SIERREUR (INDEX (table 1::A, CORRESPONDENCE (LINE (−1, Table 1::C), 0)),"")

    Of course, you can also simply filter on column B without the need to set up a column from another table or index.

    SG

  • How can I connect to my server (which runs on windows server 2008 rc2) via IP REAL using rdp, while the VPN connection is active?

    Hello

    How can I connect to my sServer (which runs on windows server 2008 rc2) via IP REAL using rdp, while the VPN connection is active?

    Hello Marie Smith.

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the link below.

    http://social.technet.Microsoft.com/forums/en-us/winservergen/threads/

    Hope this information helps.

  • How can I save an email while I'm typing online? Sometimes they disappear, never to be found, in the middle of my type.

    How can I save my emails while typing online? I have Windows XP. My emails sometimes disappear in the middle of my type.

    You can not. Best solution is to create in your word-processing program and then copy / paste the results into the Web site message box. Bruce Hagen
    MS - MVP October 1, 2004 ~ September 30, 2010
    Imperial Beach, CA

  • How can I get rid of this 3d cube grid in my work plan? I clicked on something on the view tab.

    How can I get rid of this 3d cube grid in my work plan? I clicked on something on the view tab.

    Prospect of display/grid/see the grid

    If you do a lot and it it really bothers you, the keyboard shortcut could be modified/deleted.

  • How can I download Creative Suite 5.5 that I bought before and it now takes on another computer?

    How can I download Creative Suite 5.5 that I bought before and it now takes on another computer?

    Follow this link to download & install:

    https://helpx.Adobe.com/Creative-Suite/KB/CS5-5-product-downloads.html

    Concerning

    Stéphane

  • How can Photoshop 6.0 compatible with Mac OS Mavericks or Yosemite and if so, I install it?

    How can Photoshop 6.0 compatible with Mac OS Mavericks or Yosemite and if so, I install it?

    If you mean Photoshop CS6, yes it is. Simply run the installation program.

    If you mean Photoshop 6, none that is too old. It was made for older PPC Macs. It will not install

    If you mean that Photoshop Elements 6, please see the forums of Photoshop Elements for advice on this.

    (Sometimes posters use 6 to designate everything above).

    Gene

Maybe you are looking for

  • 10 IOS leading to the Bluetooth problem

    Before download IOS 10, I've never known a Bluetooth problem when using my Ford truck. Now, when I get a call, the caller does not hear me and I can't hear the caller. If I have my phone in hand and I change the Bluetooth audio to the speaker of the

  • What kind of card do need me for the replacement of mini

    Hi - First of all some context.   My husband has dementia and the only thing he can still do is some art works and send them to friends and surf the internet.   He spent hours on his old Mac Mini up to last week, when the hard drive is dead.  I took

  • Network Realtek PCIe none seeing green or orange

    I'm having a HP touchsmart 300-1360 pc and was working fine until after a storm of light that affected my region and cooked my router and my network card stop working and it did not appear on the Device Manager. After a few days the PCIe reatek'a wen

  • I need a copy of windows XP

    My dad had it on his desk, but then put in a 500gig Xp Player did not like to be moved. The code is on the side of the computer for XP and I read that if you sent Windows they would send you a XP disk because you owned before. How do you do that? Not

  • BrowserField BlackBerry: How to get the value of the existing cookie

    Hello First of all, I want to let you know that I have to create a Web page at www.mydomain.com/whois.html then I put a cookie with javascript named 'user name = adrian' on this page In my Aplication BB I declare browserfield to load "whois.html". He