Android Open Source - minha-parte-na-conta Start New Bar Account






From Project

Back to project page minha-parte-na-conta.

License

The source code is released under:

Copyright (c) 2015, Daniel Monteiro All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:...

If you think the Android project minha-parte-na-conta listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package br.odb.myshare;
/*  w w  w. ja v  a  2  s  .  com*/
import br.odb.myshare.datamodel.BarAccount;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class StartNewBarAccount extends Activity implements OnClickListener {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_start_new_bar_account);
    
    Button btn;
    
    btn = (Button) findViewById( R.id.btnContinueAccount );
    btn.setOnClickListener( this );

    btn = (Button) findViewById( R.id.btnNewBarAccount );
    btn.setOnClickListener( this );
  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.start_new_bar_account, menu);
    return true;
  }

  @Override
  public boolean onMenuItemSelected(int featureId, MenuItem item) {
    
    Intent intent = new Intent(this, ShowCreditsActivity.class);
    startActivity(intent);
    return true;
  }

  
  
  @Override
  protected void onPause() {
    if ( BarAccount.getCurrentBarAccount() != null )
      BarAccount.getCurrentBarAccount().saveAccount( this );

    super.onPause();
  }

  @Override
  protected void onDestroy() {
    
    if ( BarAccount.getCurrentBarAccount() != null )
      BarAccount.getCurrentBarAccount().saveAccount( this );
    
    super.onDestroy();
  }

  public void onClick( View btn ) {
  
    
    BarAccount.createNewBarAccount();

    switch ( btn.getId() ) {
    
    case R.id.btnNewBarAccount:
        BarAccount.getCurrentBarAccount().saveAccount( this );
        
      case R.id.btnContinueAccount:
        
        BarAccount.getCurrentBarAccount().restoreAccount( this );
        Intent intent = new Intent( this, RegisterPeopleActivity.class );
        startActivity( intent );        
        break;
    }    
  }
}




Java Source Code List

br.odb.myshare.ApplicationTest.java
br.odb.myshare.CalculateShareActivity.java
br.odb.myshare.CheckoutActivity.java
br.odb.myshare.CheckoutFragment.java
br.odb.myshare.NavigationDrawerFragment.java
br.odb.myshare.RegisterPeopleActivity.java
br.odb.myshare.RegisterPeopleFragment.java
br.odb.myshare.RegisterProductActivity.java
br.odb.myshare.RegisterProductFragment.java
br.odb.myshare.ShowCreditsActivity.java
br.odb.myshare.ShowCreditsFragment.java
br.odb.myshare.ShowFinalCheckoutActivity.java
br.odb.myshare.ShowFinalCheckoutActivity.java
br.odb.myshare.StartNewBarAccountFragment.java
br.odb.myshare.StartNewBarAccount.java
br.odb.myshare.datamodel.BarAccount.java
br.odb.myshare.datamodel.BarAccount.java
br.odb.myshare.datamodel.Item.java
br.odb.myshare.datamodel.Item.java
br.odb.myshare.datamodel.Person.java
br.odb.myshare.datamodel.Person.java