Trying to create an ExpandableListView. The initial view with the groups shows up fine. However, when I click the list item, my arrow does not change. See the images below.<
subject:
int width = getResources().getDisplayMetrics().widthPixels;
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN_MR2) {
listView.setIndicatorBounds(width - getPixelValue(40), width - getPixelValue(10));
} else {
listView.setIndicatorBoundsRelative(width - getPixelValue(40), width - getPixelValue(10));
}
and helper method:
public static int getPixelValue(int dp) {
final float scale = getResources().getDisplayMetrics().density;
return (int) (dp * scale + 0.5f);
}