@Override
 public void onActivityCreated(Bundle savedInstanceState) {
   super.onActivityCreated(savedInstanceState);
   switch (getMainAction()) {
     case EDIT:
       setTitle(R.string.menu_item_edit_Buchung);
       setSubTitle(Account.getAccountName(mUmsatz.getAccountID()));
       break;
     case ADD:
       setTitle(R.string.menu_item_add_Buchung);
       setSubTitle(Account.getAccountName(mUmsatz.getAccountID()));
       break;
     default:
       setTitle(Account.getAccountName(mUmsatz.getAccountID()));
   }
 }
Exemple #2
0
 @Override
 protected boolean onBindView(
     AWLibViewHolder holder, View view, int resID, Cursor cursor, int cursorPosition) {
   switch (resID) {
     case R.id.tvEinstandsPreis:
       mEinstand = cursor.getLong(cursorPosition);
       AWTextCurrency tc = (AWTextCurrency) view;
       tc.setValue(mEinstand);
       return true;
     case R.id.tvGewinnVerlust:
       mGewinn = cursor.getLong(cursorPosition);
       tc = (AWTextCurrency) view;
       tc.setValue(mGewinn);
       return true;
     case R.id.tvUebersichtSaldo:
     case R.id.tvGewinnSteuerfrei:
       tc = (AWTextCurrency) view;
       tc.setValue(cursor.getLong(cursorPosition));
       return true;
     case R.id.tvGewinnVerlustProzent:
       TextView tv = (TextView) view;
       if (mEinstand != 0) {
         long mGewinnPercent = mGewinn * 10000 / mEinstand;
         tv.setText(DBConvert.convertPercent(mGewinnPercent));
       }
       return true;
     case R.id.tvUebersichtName:
       int mAccountID;
       tv = (TextView) view;
       mAccountID = cursor.getInt(columnAccountID);
       if (mAccountID == NOID) {
         tv.setText(getString(R.string.tvMarktwert));
       } else {
         tv.setText(Account.getAccountName(mAccountID));
       }
       return true;
     default:
       return super.onBindView(holder, view, resID, cursor, cursorPosition);
   }
 }