Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_initial_setup, container, false); getActivity().setTitle(R.string.initial_setup_title); etAmount = (EditText) view.findViewById(R.id.etAmount); btnNext = (ImageButton) view.findViewById(R.id.btnNext); btnNext.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (!etAmount.getText().toString().isEmpty()) { getActivity().setProgressBarIndeterminateVisibility(true); Double amount = Double.parseDouble(etAmount.getText().toString()); Category categoryReference = ParseObject.createWithoutData(Category.class, "93BaEoZPfo"); Transaction transaction = new Transaction(); transaction.setAmount(amount); transaction.setUser((User) User.getCurrentUser()); transaction.setTransactionDate(new Date()); transaction.setCategory(categoryReference); transaction.setName(getString(R.string.initial_setup_transaction_name)); transaction.setType(TransactionType.DEBIT); transaction.saveInBackground(new SaveCallback() { @Override public void done(ParseException e) { if (e != null) { Toast.makeText(getActivity(), getString(R.string.parse_error_saving), Toast.LENGTH_LONG).show(); Log.d("DEBUG", e.getMessage()); getActivity().setProgressBarIndeterminateVisibility(false); } else { User currentUser = (User) User.getCurrentUser(); currentUser.setSetup(true); currentUser.saveInBackground(new SaveCallback() { @Override public void done(ParseException e) { if (e != null) { Toast.makeText(getActivity(), getString(R.string.parse_error_saving), Toast.LENGTH_LONG).show(); Log.d("DEBUG", e.getMessage()); getActivity().setProgressBarIndeterminateVisibility( false); } else { listener.onSuccessfulSetup(); } } }); } } }); } else { Toast.makeText(getActivity(), getString(R.string.error_amount_require), Toast.LENGTH_SHORT).show(); } } }); return view; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_initial_setup, container, false); getActivity().setTitle(R.string.initial_setup_title); etAmount = (EditText) view.findViewById(R.id.etAmount); btnNext = (ImageButton) view.findViewById(R.id.btnNext); btnNext.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (!etAmount.getText().toString().isEmpty()) { getActivity().setProgressBarIndeterminateVisibility(true); Double amount = Double.parseDouble(etAmount.getText().toString()); Category categoryReference = ParseObject.createWithoutData(Category.class, getString(R.string.initial_setup_category_bills_object_id)); Transaction transaction = new Transaction(); transaction.setAmount(amount); transaction.setUser((User) User.getCurrentUser()); transaction.setTransactionDate(new Date()); transaction.setCategory(categoryReference); transaction.setName(getString(R.string.initial_setup_transaction_name)); transaction.setType(TransactionType.DEBIT); transaction.saveInBackground(new SaveCallback() { @Override public void done(ParseException e) { if (e != null) { Toast.makeText(getActivity(), getString(R.string.parse_error_saving), Toast.LENGTH_LONG).show(); Log.d("DEBUG", e.getMessage()); getActivity().setProgressBarIndeterminateVisibility(false); } else { User currentUser = (User) User.getCurrentUser(); currentUser.setSetup(true); currentUser.saveInBackground(new SaveCallback() { @Override public void done(ParseException e) { if (e != null) { Toast.makeText(getActivity(), getString(R.string.parse_error_saving), Toast.LENGTH_LONG).show(); Log.d("DEBUG", e.getMessage()); getActivity().setProgressBarIndeterminateVisibility( false); } else { listener.onSuccessfulSetup(); } } }); } } }); } else { Toast.makeText(getActivity(), getString(R.string.error_amount_require), Toast.LENGTH_SHORT).show(); } } }); return view; }