Sometimes you need to display some separation lines in the list. This can be done by deriving BaseAdapter and reloading the areAllItemsEnabled and isEnabled methods.
Boolean isEnabled (int position)
If the return value is "true", it indicates that the location is not a separator. If the return value is "false", it indicates that the behavior separator line is used. The separator line does not support click events. In this example, the line starting with "-" is defined as a separator line:
[Java]
@ Override
Public boolean isEnabled (int position ){
Return! MStrings [position]. startsWith ("-");
}
@ Override
Public boolean isEnabled (int position ){
Return! MStrings [position]. startsWith ("-");
}
In addition, if the list contains delimiters, areAllItemsEnabled must return false.
[Java]
@ Override
Public boolean areAllItemsEnabled (){
Return false;
}
@ Override
Public boolean areAllItemsEnabled (){
Return false;
}