Search code examples
user-interfaceblackberryjava-mecustom-controlsblackberry-storm

Blackberry Storm - focus issue on bitmap field


in my screen there are 3 managers h1 h2 bmpf = new BitmapField

added in order like this as

backgroundmanager.add(h1)
backgroundmanager.add(bmpf)
backgroundmanager.add(h2)

add(background manager);

protected boolesn navigationClick()
{
int index1 = h1.getFieldWithFocusIndex();
int index2 = h2.getFieldWithFocusIndex();
return true;
}

mow i get the focus index of all focussable fields in managers h1 and h2

but i cant get index of the bitnmapfield on focus i need to execute some code on its click

what to do


Solution

  • well i set the extent of the bitmap field and placed the bitmap field in an horizontal field manager and it worked

    in

    class myscreen extends MainScreen
     {
        BitmapField mBitmapField;
    
        hm = new HorizontalFieldManager();
        hm.add(mBitmapField)
    
        protected boolean navigationClick(int status, int time)
       {       
            if (hm.getFieldWithFocusIndex==0) 
            {
                 Dialog.inform("Image focussed");
            }
            return true;
        }
    }
    

    i dont understand why earlier same logic was not working!!!!!!!!!!

    may be bcoz of extent of BitmapField