To apply onclickListener on GridView in BlackBerry -
I added a grid to 9 pictures and clicking on any image, I was trying to navigate to some page Am But I'm not able to set up a listener on GridField Manager. I tried the following code:
grid.add (bmp1); Grid.add (bmp2); Grid.add (bmp3); Grid.add (BMP4); Grid.add (bmp5); Grid.setChangeListener (new field change listener); (Grid); } The square changes the field changer execution Field Change Listener {Public Zero Field changed (Field Field, Int arg1) {/ TODO Auto generated method Stub system. OutprintLine ("Inside Method:" + Field. If (Field == BMP1) {Dialog.alert ("1 Clicks");} If (Field == BMP2) {Dialog.alert ("2 Clicked ");} if (field == BMP3) {Dialog.alert (" 3 is clicked ");} If (field == BMP4) {Dialog.alert (" 4 clicked " );} If (field == BMP5) {Dialog.alert ("5 is clicked");}
A manager is used to arrange the field of its own focus And not getting clicks (normally). Note and use field to get the clicks until you have a good reason to change the behavior.
If you have a click effect after Manager then you can create a custom manager and click Navigation Methode.
Comments
Post a Comment