Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.transactions); Bundle extras = getIntent().getExtras(); Bank bank = BankFactory.bankFromDb(extras.getLong("bank"), this, false); if (bank == null) { redirectToMain(getString(R.string.error_bank_not_found)); return; } Account account = BankFactory .accountFromDb(this, extras.getLong("bank") + "_" + extras.getString("account"), true); if (account == null) { redirectToMain(getString(R.string.error_account_not_found)); return; } TextView viewBankName = (TextView) findViewById(R.id.txtListitemAccountsGroupAccountname); TextView viewAccountName = (TextView) findViewById(R.id.txtListitemAccountsGroupBankname); TextView viewAccountBalance = (TextView) findViewById(R.id.txtListitemAccountsGroupTotal); ImageView icon = (ImageView) findViewById(R.id.imgListitemAccountsGroup); viewBankName.setText(bank.getDisplayName()); viewAccountName.setText(account.getName()); viewAccountBalance .setText(Helpers.formatBalance(account.getBalance(), account.getCurrency(), false)); icon.setImageResource(bank.getImageResource()); List<Transaction> transactions = account.getTransactions(); if (!transactions.isEmpty()) { Collections.sort(transactions); findViewById(R.id.txtTranDesc).setVisibility(View.GONE); TransactionsAdapter adapter = new TransactionsAdapter(transactions); ListView viewTransactionsList = (ListView) findViewById(R.id.lstTransactionsList); viewTransactionsList.setAdapter(adapter); } findViewById(R.id.layBankHeader).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.transactions); Bundle extras = getIntent().getExtras(); Bank bank = BankFactory.bankFromDb(extras.getLong("bank"), this, false); if (bank == null) { redirectToMain(getString(R.string.error_bank_not_found)); return; } Account account = BankFactory .accountFromDb(this, extras.getLong("bank") + "_" + extras.getString("account"), true); if (account == null) { redirectToMain(getString(R.string.error_account_not_found)); return; } TextView viewBankName = (TextView) findViewById(R.id.txtListitemAccountsGroupAccountname); TextView viewAccountName = (TextView) findViewById(R.id.txtListitemAccountsGroupBankname); TextView viewAccountBalance = (TextView) findViewById(R.id.txtListitemAccountsGroupTotal); ImageView icon = (ImageView) findViewById(R.id.imgListitemAccountsGroup); viewBankName.setText(bank.getDisplayName()); viewAccountName.setText(account.getName()); viewAccountBalance .setText(Helpers.formatBalance(account.getBalance(), account.getCurrency())); icon.setImageResource(bank.getImageResource()); List<Transaction> transactions = account.getTransactions(); if (!transactions.isEmpty()) { Collections.sort(transactions); findViewById(R.id.txtTranDesc).setVisibility(View.GONE); TransactionsAdapter adapter = new TransactionsAdapter(transactions); ListView viewTransactionsList = (ListView) findViewById(R.id.lstTransactionsList); viewTransactionsList.setAdapter(adapter); } findViewById(R.id.layBankHeader).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); }