2

can anyone help me for solving the below question. I am making an application for blackberry in that from one bitmapField i have to invoke a new screen by clicking on the bitmapField. I want the code for the same... how to invoke a new screen by clicking on a bitmapField... and i am using blackberry JDE 4.7

Maksym Gontar
  • 22,765
  • 10
  • 78
  • 114
Dean Jones
  • 21
  • 1
  • 2

3 Answers3

4

Try making the BitmapField focusable

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

This might help

Rigobert Song
  • 2,766
  • 2
  • 30
  • 47
2
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

Nate
  • 31,017
  • 13
  • 83
  • 207
Swati
  • 2,870
  • 7
  • 45
  • 87
1

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;
   }
}
Nate
  • 31,017
  • 13
  • 83
  • 207
Alex
  • 3,382
  • 2
  • 32
  • 41