Source:
<code>protected void onCreate(Bundle savedInstanceState) { Utilities.setActivityTheme(this, getApplicationContext()); super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_entry); mAmountView = (EditText) findViewById(R.id.entry_amount); mBudgetView = (Spinner) findViewById(R.id.spinner_budget); mDateView = (DatePicker) findViewById(R.id.entry_date_picker); mNotesView = (EditText) findViewById(R.id.entry_notes); mAddButtonView = (Button) findViewById(R.id.add_entry_button); addItemsToBudgetSpinner(); Bundle bundle = getIntent().getExtras(); addMode = bundle.getBoolean("Add", true); if (addMode) { setTitle(MessageFormat.format(getTitle().toString(), getString(R.string.title_entry_add))); mAddButtonView.setText(getString(R.string.entry_activity_button_add)); } else { setTitle(MessageFormat.format(getTitle().toString(), getString(R.string.title_entry_edit))); mAddButtonView.setText(getString(R.string.entry_activity_button_edit)); Budget b = Budget.getBudgetById(bundle.getLong("BudgetId")); Entry e = b.getEntryById(bundle.getLong("EntryId")); <START> mAmountView.setText("" + (double) e.getAmount() / Utilities.DOLLOR_IN_CENTS); <END> LocalDate date = e.getDate(); mDateView.updateDate(date.getYear(), date.getMonthOfYear(), date.getDayOfMonth()); mNotesView.setText(e.getNotes()); ArrayAdapter<String> editAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, new String[]{b.getName()}); mBudgetView.setAdapter(editAdapter); mBudgetView.setEnabled(false); } getIntent().setAction("Already created"); }</code><technical_language>print format amount instead of manipulating data</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { Utilities.setActivityTheme(this, getApplicationContext()); super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_entry); mAmountView = (EditText) findViewById(R.id.entry_amount); mBudgetView = (Spinner) findViewById(R.id.spinner_budget); mDateView = (DatePicker) findViewById(R.id.entry_date_picker); mNotesView = (EditText) findViewById(R.id.entry_notes); mAddButtonView = (Button) findViewById(R.id.add_entry_button); Log.d(TAG, "After views"); addItemsToBudgetSpinner(); Log.d(TAG, "After budget spinner"); Bundle bundle = getIntent().getExtras(); addMode = bundle == null ? true : bundle.getBoolean("Add", true); if (addMode) { setTitle(MessageFormat.format(getTitle().toString(), getString(R.string.title_entry_add))); mAddButtonView.setText(getString(R.string.entry_activity_button_add)); } else { setTitle(MessageFormat.format(getTitle().toString(), getString(R.string.title_entry_edit))); mAddButtonView.setText(getString(R.string.entry_activity_button_edit)); Budget b = Budget.getBudgetById(bundle.getLong("BudgetId")); Entry e = b.getEntryById(bundle.getLong("EntryId")); mAmountView.setText(Utilities.amountToDollarsNoDollarSign(e.getAmount())); LocalDate date = e.getDate(); mDateView.updateDate(date.getYear(), date.getMonthOfYear() - 1, date.getDayOfMonth()); mNotesView.setText(e.getNotes()); ArrayAdapter<String> editAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, new String[]{b.getName()}); mBudgetView.setAdapter(editAdapter); mBudgetView.setEnabled(false); } getIntent().setAction("Already created"); }