BlackBerry - Invoke a click event on bitmap Field
can anyone help me for solving the below question. I am making an appli开发者_如何学运维cation 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
Try making the BitmapField focusable
BitmapField bm = new BitmapField(bitmap, BitmapField.FOCUSABLE);
This might help
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
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;
}
}
精彩评论