NoSuchMethod exception for setShowDividers

I would like to display a ListView view with dividing lines between each item. Since each line of this list will display a different user view, I thought it would be easier to use a TableLayout and use setShowDividersand SHOW_DIVIDER_MIDDLEto show this white line between each element.

Why am I getting a NoSuchMethod exception in setShowDividers?

 TableLayout table = (TableLayout)findViewById(R.id.my_table_layout);
 if( table != null )
 {
      table.setShowDividers(TableLayout.SHOW_DIVIDER_MIDDLE);
 }

I also get the same error if instead I do everything on LinearLayout.

+2
source share
1 answer

What purpose API do you use? setShowDividerswas added to API level 11 (Honeycomb).

+3

All Articles