Blackberry GPS and BlackBerry Maps Manual - Halaman 22
Jelajahi secara online atau unduh pdf Manual untuk Perangkat lunak Blackberry GPS and BlackBerry Maps. Blackberry GPS and BlackBerry Maps 35 halaman. Version: 4.7.0
Development Guide
*/
public String toString()
{
return "Menu Item Demo";
}
/**
* Code that executes when a BlackBerry smartphone user clicks the
menu item.
* @param context A MapView object.
* @return null
*/
public Object run(Object context)
{
if (context instanceof MapView )
{
the UI screen.
app.pushScreen( new MapsMenuItemScreen(_mv) );
}
return null;
}
}
}
11.
In the main() method, register a menu item with BlackBerry Maps.
public static void main(String[] args) {
if (args != null && args.length > 0)
{
if (args[0].equals("startup"))
{
smartphone starts.
ApplicationMenuItemRepository.getInstance();
ApplicationDescriptor.currentApplicationDescriptor();
(ad_startup , "gui", new String[]{"gui"});
(ApplicationMenuItemRepository.MENUITEM_MAPS , new MapsMenuItem() ,
ad_gui);
}
else if (args[0].equals("gui"))
{
20
_mv = (MapView)context;
//
Obtain the instance of the UiApplication and display
UiApplication app = UiApplication.getUiApplication();
app.requestForeground();
// Register an ApplicationMenuItem when the BlackBerry
ApplicationMenuItemRepository amir =
ApplicationDescriptor ad_startup =
ApplicationDescriptor ad_gui = new ApplicationDescriptor
amir.addMenuItem
Displaying location information on a BlackBerry device