/**
   * Called when the activity is first created. Retrieves the wufoo form and inserts it into the
   * view.
   *
   * @param savedInstanceState Um I don't even know. Read the Android documentation.
   */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    if (android.os.Build.VERSION.SDK_INT >= 11) setTheme(R.style.Default_New);
    super.onCreate(savedInstanceState);

    wv = new WebView(this);
    wv.getSettings().setJavaScriptEnabled(true);
    wv.addJavascriptInterface(new JavascriptInterface(), "HTMLOUT");
    wv.setWebViewClient(new RestoreDraftClient());

    FrameLayout fl = new FrameLayout(this);
    fl.setBackgroundResource(R.color.backClr);
    fl.addView(wv);
    setContentView(fl);
    setTitle(R.string.contact);

    baconPDialog =
        Callisto.BaconDialog(
            ContactForm.this, this.getResources().getString(R.string.loading) + "...", null);
    baconPDialog.setOnCancelListener(
        new OnCancelListener() {
          @Override
          public void onCancel(DialogInterface dialog) {
            // Finish the activity if the fetching is canceled
            finish();
          }
        });
    baconPDialog.setCancelable(true);
    thatWhichWillReadTheCSS = new ReadCSS();
    thatWhichWillReadTheCSS.execute((Void[]) null);
  }
  /**
   * Called when the activity is first created. Sets up the view.
   *
   * @param savedInstanceState Um I don't even know. Read the Android documentation.
   */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    String TAG = StaticBlob.TAG();
    if (android.os.Build.VERSION.SDK_INT >= 11) setTheme(R.style.Default_New);
    // General create stuff
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    Log.v(TAG, "Launching Activity");
    mainListView = new ListView(this);
    Callisto.build_layout(this, mainListView);

    // Get the settings for this show
    currentShow = getIntent().getExtras().getString("current_show");
    currentShowAudio = getIntent().getExtras().getString("current_show_audio");
    currentShowVideo = getIntent().getExtras().getString("current_show_video");
    showSettings = getSharedPreferences(currentShow, 0);
    filter = showSettings.getBoolean("filter", false);
    loading = (TextView) findViewById(android.R.id.empty);
    // If it has been checked before but there are no episodes, show that it is empty, not just
    // loading.
    if (StaticBlob.databaseConnector.getShow(currentShow, filter).getCount() == 0)
      loading.setText(this.getResources().getString(R.string.list_empty));
    else loading.setText(this.getResources().getString(R.string.loading));
    loading.setGravity(Gravity.CENTER_HORIZONTAL);
    // If it has never been checked before add a refresh button
    if (showSettings.getString("last_checked", null) == null) {
      refresh = new Button(this);
      refresh.setText(this.getResources().getString(R.string.refresh));
      refresh.setTextColor(this.getResources().getColor(R.color.txtClr));
      LinearLayout.LayoutParams p =
          new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
      p.setMargins(20, 10, 20, 10);
      refresh.setLayoutParams(p);
      ((LinearLayout) loading.getParent()).setGravity(Gravity.CENTER_HORIZONTAL);
      refresh.setPadding(100, 10, 100, 10);
      refresh.setOnClickListener(
          new OnClickListener() {
            @Override
            public void onClick(View v) {
              reload();
            }
          });
      ((LinearLayout) mainListView.getParent()).addView(refresh, 1);
      ((LinearLayout) mainListView.getParent())
          .setBackgroundColor(this.getResources().getColor(R.color.backClr));
      mainListView.setEmptyView(refresh);
      loading.setVisibility(View.INVISIBLE);
    } else {
      mainListView.setEmptyView(loading);
    }
    // Finish setting up the listview
    mainListView.setOnItemClickListener(selectEpisode);
    mainListView.setBackgroundColor(getResources().getColor(R.color.backClr));
    mainListView.setCacheColorHint(getResources().getColor(R.color.backClr));
    setTitle(currentShow);
    // Get the shows from the SQL; make it async because of reasons
    new GetShowTask().execute((Object[]) null);
    Cursor r = StaticBlob.databaseConnector.getShow(currentShow, filter);
    showAdapter = new ShowListCursorAdapter(ShowList.this, R.layout.row, r);
    mainListView.setAdapter(showAdapter);
    return;
  }