Back to project page minha-parte-na-conta.
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.
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; } } }