Join a customer-defined menu item to existing applications (BlackBerry, Model: 7520)

xiaoxiao2021-03-06  17

A few days ago, I was thinking about a problem, that is, the menu of the BLACKBERRY system application,

I intend to divide a few steps:

1) If you really can do this, after all, BlackBerry is another operating system.

2) I can join, how to join

3) After joining, how to implement your own function

This problem has already been plagued for a long time, I looked at BlackBerry's SDK, I found a few categories about Menu. I am thinking, I should be able to start with these classes. In the past few days, I found a few open sources. The tool, unfortunately, no source code, but this shows that the first step is feasible, how to achieve step 2, have read these classes and their documents:

Got the following code:

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. 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 ...";

Public Object Run (Object Context) {system.out.println (Context); // do what you want to doreturn context;}}

This step 2 has been implemented

The next step 3 will continue to work harder, I believe it is not very difficult.

转载请注明原文地址:https://www.9cbs.com/read-44719.html

New Post(0)