Search code examples
java-memidplcdui

Checking the CustomItem in j2me support traversal or not


Checking the CustomItem in j2me support traversal or not?

How should I check the CustomItem in j2me support traversal or not?


Solution

  • I find the solution. It's working for me.

    The correct solution Finding the CustomItem traversal is supported by the device calling the method "getInteractionModes()" of the class "javax.microedition.lcdui.CustomItem".

    Code snippet is given below

    int supported_interaction_modes=this.getInteractionModes();
    boolean horizontal__interaction,vertical_interaction;
    if((supported_interaction_modes&CustomItem.TRAVERSE_HORIZONTAL)!=0)        //Horizontal traverse support
      horizontal_interaction=true;
    else
      horizontal_interaction=false;
    if((supported_interaction_modes&CustomItem.TRAVERSE_VERTICAL)!=0)
      vertical_interaction=true;        
    else
      vertical_interaction=false;
    

    in the above code snippet the "this" refers to the object of the class which is derived from "javax.microedition.lcdui.CustomItem"