[Android Studio] anduong:
My activity

public class PlanSetterAct extends AppCompatActivity {
private Button nextBtn;
private EditText planName, weekNum;
private ExpandableListView weekdayList;
List<String> listDataHeader;
HashMap<String, List<String>> listDataChild;
private PlanSetterListAdapter adapter;
private int childCount = 0;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.plan_setter);

weekdayList = (ExpandableListView) findViewById(R.id.plan_setter_exercise_list);
nextBtn = (Button) findViewById(R.id.plan_next_btn);
planName = (EditText) findViewById(R.id.plan_name_edit);
weekNum = (EditText) findViewById(R.id.plan_num_edit);

prepareNextButton();
prepareExerciseList();
adapter = new PlanSetterListAdapter(this.getApplicationContext(),listDataHeader,listDataChild);
weekdayList.setAdapter(adapter);
exerciseListChildListener();
}
private void prepareNextButton(){
nextBtn.animate().setDuration(1000);
nextBtn.animate().translationXBy(-500);

nextBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(Checker.hasText(planName) && Checker.isNum(weekNum)){
Utilities.setButtonClickColor(nextBtn, Color.GREEN);
startActivity(new Intent(PlanSetterAct.this, UserMainAct.class));
finish();
Utilities.debugLog("Moving to UserMainAct");
}else{
Utilities.setButtonClickColor(nextBtn, Color.RED);
}
}
});
}
private void prepareExerciseList() {
listDataHeader = new ArrayList<String>();
listDataChild = new HashMap<String, List<String>>();

// Adding child data
listDataHeader.add("Monday");
listDataHeader.add("Tuesday");
listDataHeader.add("Wednesday");
listDataHeader.add("Thursday");
listDataHeader.add("Friday");
listDataHeader.add("Saturday");
listDataHeader.add("Sunday");

for(int i = 0; i < listDataHeader.size(); i++) {
listDataChild.put(listDataHeader.get(i), new ArrayList<String>());
}
}

private void exerciseListChildListener(){
weekdayList.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {

ExpandableListView expandableListView = (ExpandableListView) parent;
long pos = expandableListView.getExpandableListPosition(position);

int itemType = ExpandableListView.getPackedPositionType(pos);
int groupPosition = ExpandableListView.getPackedPositionGroup(pos);
int childPosition = ExpandableListView.getPackedPositionChild(pos);

List<String> parentGroup = listDataChild.get(listDataHeader.get(groupPosition));

if(itemType == ExpandableListView.PACKED_POSITION_TYPE_GROUP){

parentGroup.add(childPosition+"");
adapter.notifyDataSetChanged();
return true;
}else if(itemType == ExpandableListView.PACKED_POSITION_TYPE_CHILD){

debugLog("Parent position: " + groupPosition +" | child position: " + childPosition);
parentGroup.remove(childPosition);
adapter.notifyDataSetChanged();
return true;
}
return false;
}
});
}
}

My Adapter

public class PlanSetterListAdapter extends BaseExpandableListAdapter {

private Context context;
private List<String> listDataHeader;
private HashMap<String, List<String>> listDataChild;

public PlanSetterListAdapter(Context context, List<String> listDataHeader,
HashMap<String, List<String>> listChildData) {
this.context = context;
this.listDataHeader = listDataHeader;
this.listDataChild = listChildData;
}

@Override
public Object getChild(int groupPosition, int childPosititon) {
return this.listDataChild.get(this.listDataHeader.get(groupPosition))
.get(childPosititon);
}

@Override
public long getChildId(int groupPosition, int childPosition) {
return childPosition;
}

@Override
public View getChildView(int groupPosition, final int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {

final LayoutInflater inflater;
if (convertView == null) {
inflater= (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.add_exercise_layout, null);
}

final LinearLayout txtListChild = (LinearLayout) convertView.findViewById(R.id.plan_setter_add_exercise);

final LinearLayout addExerciseLayout = (LinearLayout) txtListChild.getChildAt(0);
Button okBtn = (Button) addExerciseLayout.getChildAt(1);

//init and gone from xml

okBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
TextView errorView = (TextView) txtListChild.getChildAt(1);
TextView finalView = (TextView) txtListChild.getChildAt(2);

LinearLayout exerciseAddLayout = (LinearLayout) addExerciseLayout.getChildAt(0);

EditText exerciseNameEdit = ((EditText)exerciseAddLayout.getChildAt(0));
EditText exerciseLbsEdit = (EditText)exerciseAddLayout.getChildAt(2);
EditText exerciseRepsEdit = (EditText) exerciseAddLayout.getChildAt(4);

if(hasText(exerciseNameEdit) && isNum(exerciseLbsEdit) && isNum(exerciseRepsEdit)){
String exerciseNameStr = exerciseNameEdit.getText().toString();
String exerciseWeightStr = exerciseLbsEdit.getText().toString()+"lbs";
String exerciseRepsStr = exerciseLbsEdit.getText().toString()+"x";

finalView.setText(exerciseNameStr + " at " + exerciseWeightStr + " for " +exerciseRepsStr);
finalView.setTextSize(20);

//display
setVisibleAndAnimate(context,finalView);
addExerciseLayout.setVisibility(View.GONE);
errorView.setVisibility(View.GONE);
}else{
setVisibleAndAnimate(context,errorView);
}
}
});

return convertView;
}

@Override
public int getChildrenCount(int groupPosition) {
return this.listDataChild.get(this.listDataHeader.get(groupPosition))
.size();
}

@Override
public Object getGroup(int groupPosition) {
return this.listDataHeader.get(groupPosition);
}

@Override
public int getGroupCount() {
return this.listDataHeader.size();
}

@Override
public long getGroupId(int groupPosition) {
return groupPosition;
}

@Override
public View getGroupView(int groupPosition, boolean isExpanded,
View convertView, ViewGroup parent) {
String headerTitle = (String) getGroup(groupPosition);
if (convertView == null) {
LayoutInflater infalInflater = (LayoutInflater) this.context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = infalInflater.inflate(R.layout.expandable_list_parent, null);
}

TextView lblListHeader = (TextView) convertView
.findViewById(R.id.lblListHeader);
lblListHeader.setTypeface(null, Typeface.BOLD);
lblListHeader.setText(headerTitle);

return convertView;
}

@Override
public boolean hasStableIds() {
return false;
}

@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
return true;
}
}