BlackBerry - Invoke a click event on bitmap Field

帅比萌擦擦* 提交于 2019-12-06 11:49:15

Try making the BitmapField focusable

BitmapField bm = new BitmapField(bitmap, BitmapField.FOCUSABLE);

This might help

Swati
BitmapField bmpField = new BitmapField(bitmap, BitmapField.FOCUSABLE)

   protected boolean navigationClick(int status, int time)
   {
      if(bmpField.isFocus)
      {
          UiApplication.getUiApplication().pushScreen(new MyScreen());
      }
      return true;
   }
}

i have used on a Storm and it works.

If even this does not work, u can go ahead and use touchEvent instead of navigationClick

Alex

This must work

BitmapField bmpField = new BitmapField(bitmap, BitmapField.FOCUSABLE){

   protected void drawFocus(Graphics graphics, boolean on){
      //the simplies way to draw a rectangle and this will be the focus
   }                               

   protected boolean navigationClick(int status, int time)
   {
      //write here your code what you want to run the user clicks to the bitmap
      //try something like this
      UiApplication.getUiApplication().pushScreen(new MyScreen());
      return true;
   }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!