Source:
public void onCreate(Bundle savedInstanceState) { Log.d(TAG, "onCreate()"); Log.d(TAG, "savedInstanceState=" + savedInstanceState); try { super.onCreate(savedInstanceState); this.sqlHelper = SQLHelperFactory.getSQLHelper(this); this.savedSelection = null; this.setContentView(R.layout.card_list); this.filterStatus = this.getResources().getInteger( R.integer.no_filter); if (savedInstanceState != null) { this.filterStatus = savedInstanceState.getInt(this .getString(R.string.filter_status_extra)); this.filterParams = savedInstanceState.getBundle(this .getString(R.string.filter_params_extra)); this.savedSelection = savedInstanceState.getBooleanArray(this .getString(R.string.selection_extra)); } this.emptyList = (TextView) this.findViewById(android.R.id.empty); Resources res = this.getResources(); if (this.filterStatus == res.getInteger(R.integer.no_filter)) { this.emptyList.setText(R.string.start); } else { this.emptyList.setText(R.string.empty_list); } ListView listView = (ListView) this.findViewById(android.R.id.list); this.headerView = View.inflate(this, R.layout.list_header, null); ((CheckedTextView) this.headerView.findViewById(R.id.checkmark)) .setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { CheckedTextView ctv = (CheckedTextView) v .findViewById(R.id.checkmark); ctv.toggle(); BaseballCardList.this.adapter.toggleAll(ctv .isChecked()); } }); listView.addHeaderView(this.headerView); listView.setEmptyView(this.emptyList); listView.setOnItemClickListener(this.onCardClick); this.adapter = new CheckedCursorAdapter(this, R.layout.row, null, ROW_PROJECTION, ROW_TEXT_VIEWS); } catch (SQLHelperCreationException ex) { Toast.makeText(this, R.string.database_error, Toast.LENGTH_LONG) .show(); Log.e(TAG, ex.getMessage(), ex); } }

Target:
public void onCreate(Bundle savedInstanceState) { Log.d(TAG, "onCreate()"); Log.d(TAG, "savedInstanceState=" + savedInstanceState); try { super.onCreate(savedInstanceState); this.sqlHelper = SQLHelperFactory.getSQLHelper(this); this.savedSelection = null; this.setContentView(R.layout.card_list); this.filterActive = false; if (savedInstanceState != null) { this.filterActive = savedInstanceState.getBoolean(this .getString(R.string.filter_status_extra)); this.filterParams = savedInstanceState.getBundle(this .getString(R.string.filter_params_extra)); this.savedSelection = savedInstanceState.getBooleanArray(this .getString(R.string.selection_extra)); } this.emptyList = (TextView) this.findViewById(android.R.id.empty); if (!this.filterActive) { this.emptyList.setText(R.string.start); } else { this.emptyList.setText(R.string.empty_list); } ListView listView = (ListView) this.findViewById(android.R.id.list); this.headerView = View.inflate(this, R.layout.list_header, null); ((CheckedTextView) this.headerView.findViewById(R.id.checkmark)) .setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { CheckedTextView ctv = (CheckedTextView) v .findViewById(R.id.checkmark); ctv.toggle(); BaseballCardList.this.adapter.toggleAll(ctv .isChecked()); } }); listView.addHeaderView(this.headerView); listView.setEmptyView(this.emptyList); listView.setOnItemClickListener(this.onCardClick); this.adapter = new CheckedCursorAdapter(this, R.layout.row, null, ROW_PROJECTION, ROW_TEXT_VIEWS); } catch (SQLHelperCreationException ex) { Toast.makeText(this, R.string.database_error, Toast.LENGTH_LONG) .show(); Log.e(TAG, ex.getMessage(), ex); } }