Sunday, August 30, 2009

Clickable BitmapField



For making BitmapField clickable
------------------------------------------------

Bitmap image = Bitmap.createBitmapFromResource("button.png");
BitmapField imageButton = new BitmapField(image, BitmapField.FOCUSABLE)
{
private XYRect xyrect=new XYRect();
protected boolean navigationClick(int status, int time)
{
// This is method will invoke after clicking the image
// System.out.println("Image Clicked");
return true;
}
};

6 comments:

  1. On Click I want to open a new screen.

    ReplyDelete
  2. UiApplication.getUiApplication().pushScreen( new SCREENCLASS());

    ReplyDelete
  3. hello sir
    if i want it to opan a link in the browser .

    ReplyDelete
  4. From navigationClick()method call the below function:
    public static void openBrowser(String url)
    {
    BrowserSession session;
    session = Browser.getDefaultSession();
    session.displayPage(url);
    session.showBrowser();
    }

    ReplyDelete
  5. hello Bikas
    you must be good at Java i'm the anonymouse who commented about opening a link in th browser
    i have no idea what you said , its my first time to try to code an app for personal use
    i will contct you through e-mail
    i hope you can help me
    thank you sir

    ReplyDelete
  6. I want to change the button image on focus and also on click or touch.

    ReplyDelete