private void process_content_view() {
   if (ContentView != null) {
     ScrollView sv = (ScrollView) findViewById(R.id.mindpin_alert_dialog_content_panel_scrollView);
     sv.removeAllViews();
     sv.addView(ContentView);
   }
 }
  private void setUpCourseTable() {
    isHoliday = false;
    isNight = false;
    isHolidayNight = false;
    isB = false;
    isHolidayB = false;

    mScrollView.removeAllViews();
    if (mList.size() == 0) {
      if (isRetry) {
        mNoCourseTextView.setText(R.string.click_to_retry);
      } else {
        mNoCourseTextView.setText(getString(R.string.course_no_course, "\uD83D\uDE0B"));
      }
      mProgressWheel.setVisibility(View.GONE);
      mSwipeRefreshLayout.setEnabled(true);
      mSwipeRefreshLayout.setRefreshing(false);
      mNoCourseLinearLayout.setVisibility(View.VISIBLE);
      mScrollView.setVisibility(View.VISIBLE);
      mHolidayTextView.setVisibility(View.GONE);
      return;
    } else {
      mNoCourseLinearLayout.setVisibility(View.GONE);
    }
    checkCourseTableType();
    TableLayout table = selectCourseTable();

    for (int i = 0; i < mList.size(); i++) {
      if (mList.get(i) != null) {
        for (int j = 0; j < mList.get(i).size(); j++) {
          int id =
              getResources().getIdentifier("textView" + j + "_" + (i + 1), "id", getPackageName());
          final TextView courseTextView = (TextView) table.findViewById(id);
          if (mList.get(i).get(j) != null) {
            if (courseTextView == null) {
              continue;
            }
            courseTextView.setText(mList.get(i).get(j).title.substring(0, 2));

            final int weekday = i;
            final int section = j;
            courseTextView.setOnClickListener(
                new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                    showCourseDialog(weekday, section);
                  }
                });
          } else {
            if (courseTextView != null) {
              courseTextView.setText("  ");
            }
          }
        }
      } else {
        List<String> sections =
            new ArrayList<>(Arrays.asList(getResources().getStringArray(R.array.course_sections)));
        for (int j = 0; j < sections.size(); j++) {
          int id =
              getResources().getIdentifier("textView" + j + "_" + (i + 1), "id", getPackageName());
          final TextView courseTextView = (TextView) table.findViewById(id);
          if (courseTextView != null) {
            courseTextView.setText("  ");
          }
        }
      }
    }

    mScrollView.addView(table);
    mProgressWheel.setVisibility(View.GONE);
    mSwipeRefreshLayout.setEnabled(true);
    mSwipeRefreshLayout.setRefreshing(false);
    mScrollView.setVisibility(View.VISIBLE);
  }
 private void setContentView(View view) {
   _content.removeAllViews();
   _content.addView(view);
 }