Buggy code:
public class SearchFragment extends Fragment implements InputAmountDialogListener { private static final String LOGCAT = SearchFragment . class . getSimpleName ( ) ; private static final int REQUEST_PICK_PAYEE = 1 ; private static final int REQUEST_PICK_CATEGORY = 3 ; private Spinner spinAccount ; private Spinner spinStatus ; private EditText edtTransNumber ; private EditText edtNotes ; private TextView txtToAmount ; private TextView txtFromAmount ; private TextView txtSelectCategory ; private TextView txtSelectPayee ; private TextView txtFromDate ; private TextView txtToDate ; private CheckBox cbxWithdrawal ; private CheckBox cbxDeposit ; private CheckBox cbxTransfer ; private ArrayList < String > mAccountNameList = new ArrayList < String > ( ) ; private ArrayList < Integer > mAccountIdList = new ArrayList < Integer > ( ) ; private List < TableAccountList > mAccountList ; private ArrayList < String > mStatusItems = new ArrayList < String > ( ) ; private ArrayList < String > mStatusValues = new ArrayList < String > ( ) ; private boolean mDualPanel = false ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { super . onActivityCreated ( savedInstanceState ) ; <START_BUG> Core core = new Core ( getActivity ( ) . getApplicationContext ( ) ) ; <END_BUG> BaseFragmentActivity activity = ( ( BaseFragmentActivity ) ( getActivity ( ) ) ) ; if ( activity != null ) activity . getSupportActionBar ( ) . setSubtitle ( null ) ; if ( ! ( ( core . isTablet ( ) ) || ( ( VERSION . SDK_INT ) < ( VERSION_CODES . ICE_CREAM_SANDWICH ) ) ) ) { activity . getSupportActionBar ( ) . setDisplayOptions ( DISPLAY_SHOW_CUSTOM , ( ( ( ( ActionBar . DISPLAY_HOME_AS_UP ) | ( ActionBar . DISPLAY_SHOW_HOME ) ) | ( ActionBar . DISPLAY_SHOW_TITLE ) ) | ( ActionBar . DISPLAY_SHOW_CUSTOM ) ) ) ; LayoutInflater inflater = ( ( LayoutInflater ) ( getActivity ( ) . getSystemService ( LAYOUT_INFLATER_SERVICE ) ) ) ; View actionBarButtons = inflater . inflate ( actionbar_button_cancel_done , new android . widget . LinearLayout ( getActivity ( ) ) , false ) ; View cancelActionView = actionBarButtons . findViewById ( action_cancel ) ; cancelActionView . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { onDoneClick ( ) ; } } ) ; View doneActionView = actionBarButtons . findViewById ( action_done ) ; ImageView doneImageView = ( ( ImageView ) ( doneActionView . findViewById ( image_done ) ) ) ; doneImageView . setImageDrawable ( getActivity ( ) . getResources ( ) . getDrawable ( core . resolveIdAttribute ( ic_action_search ) ) ) ; TextView doneTextView = ( ( TextView ) ( doneActionView . findViewById ( text_done ) ) ) ; doneTextView . setText ( search ) ; doneActionView . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { onSearchClick ( ) ; } } ) ; activity . getSupportActionBar ( ) . setCustomView ( actionBarButtons ) ; } } @ Override public void onActivityResult ( int requestCode , int resultCode , Intent data ) { } public void onDoneClick ( ) { } public void onSearchClick ( ) { } @ Override public void onCreateOptionsMenu ( Menu menu , MenuInflater inflater ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void executeSearch ( ) { } public boolean isDualPanel ( ) { } public void setDualPanel ( boolean mDualPanel ) { } @ Override public void onFinishedInputAmountDialog ( int id , Double amount ) { } private class CategorySub { public int categId ; public String categName ; public int subCategId ; public String subCategName ; } private class OnDateButtonClickListener implements OnClickListener { private TextView mTextView ; public OnDateButtonClickListener ( TextView txtFromDate ) { } @ Override public void onClick ( View v ) { } private OnDateSetListener mDateSetListener = new DatePickerDialog . OnDateSetListener ( ) { @ Override public void onDateSet ( DatePicker view , int year , int monthOfYear , int dayOfMonth ) { } } ; } }

Fix:
Core core = new Core ( getActivity ( ) ) ;