Join a client-defined menu item into an existing application (blackberry,model:7520)

Source: Internet
Author: User
Tags join client
model| Menu | program
A few days ago, I was thinking about a problem that extends the BlackBerry System application's menu,

I intend to divide it into several steps:

1 Whether it is really possible to do so, after all, the BlackBerry is another operating system

2 then you can join and how to join

3 after joining, how to achieve their own functions

This problem has been bothering me for a long time, today I looked at the BlackBerry SDK, I found a few classes about menu, and I was thinking that we should be able to start with these. A few days ago, I looked for several open source tools, and unfortunately did not provide the source code, but this shows that the first step is feasible, The next class study is how to implement step 2nd, looking at these classes and their documentation:

The following code was obtained:

Import Net.rim.device.api.ui.*;import Net.rim.device.api.system.*;import Net.rim.device.api.ui.component.Dialog; Import Net.rim.blackberry.api.menuitem.*;import Net.rim.device.api.ui.component.*;import net.rim.device.api.ui.container.*;

public class Bbinit extends application{private static long ID = 0xe1e5ac072dc45f40l;

public static void Main (string[] args) {bbinit Theapp = new Bbinit (); Theapp.entereventdispatcher ();}

Public Bbinit () {applicationmenuitemrepository.getinstance (). AddMenuItem (applicationmenuitemrepository.menuitem_ BROWSER, New Bbmenuitem ()); }

}

Class Bbmenuitem extends Applicationmenuitem {Bbmenuitem () {super ("Print ...", 10);}    Bbmenuitem (int order) {super (order); }

Public String toString () {return "Print ...";}

The public object is run (object context) {System.out.println,//do WHAT you WANT to Doreturn context;}}

This 2nd step has been achieved

The next 3rd step, I believe it is not difficult.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.