I am working on list view with CheckedTextView,
Below is my code:
RelativeLayout parentMostLayout = new RelativeLayout(activity);
parentMostLayout.setLayoutParams(new AbsListView.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.WRAP_CONTENT));
CheckedTextView checkedTextView = new CheckedTextView(activity);
int[] attrs = { android.R.attr.listChoiceIndicatorMultiple };
TypedArray ta = activity.getTheme().obtainStyledAttributes(attrs);
Drawable indicator = ta.getDrawable(0);
checkedTextView.setCheckMarkDrawable(indicator);
ta.recycle();
parentMostLayout.addView(checkedTextView, checkedTextViewlLayoutParams);
When i try to check that item its not marking the item that i am trying to select, what might be the issue here?
EDIT
ListView listView = new ListView(activity);
listView.setCacheColorHint(Color.TRANSPARENT);
listView.setDivider(new ColorDrawable(0x99000000));
listView.setDividerHeight(1);
listView.setSelector(R.drawable.listselector);
RelativeLayout.LayoutParams listViewParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.MATCH_PARENT);
listViewParams.addRule(RelativeLayout.ABOVE, footerBar.getId());
Add below line.
where replace mListView with your Listview object name.