Android Open Source - cellar-communicator Salesman






From Project

Back to project page cellar-communicator.

License

The source code is released under:

GNU General Public License

If you think the Android project cellar-communicator 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 com.vinit.orderplacer;
/*w w  w  . j a  v a2s.c o  m*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.Toast;

public class Salesman extends Activity {

  Button next, history;
  Intent g, i;
  Spinner parties;
  RetrieveSalesmen r;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_salesman);

    g = getIntent();
    final String salesman = g.getStringExtra("salesman");
    
    Toast.makeText(this, "Welcome, " + salesman, Toast.LENGTH_SHORT).show();
    next = (Button) findViewById(R.id.next);
    history = (Button) findViewById(R.id.history);
    parties = (Spinner) findViewById(R.id.partylist);

    r = new RetrieveSalesmen(this, parties, salesman);
    r.execute();

    next.setOnClickListener(new OnClickListener() {

      @Override
      public void onClick(View v) {
        i = new Intent(getApplicationContext(), CategoryList.class);
        i.putExtra("salesman", salesman);
        i.putExtra("party", parties.getSelectedItem().toString());
        startActivity(i);
      }
    });
      
    history.setOnClickListener(new OnClickListener() {
      
      @Override
      public void onClick(View v)  {
        // TODO separate intents
        i = new Intent(getApplicationContext(), SalesHistory.class);
        i.putExtra("salesman", salesman);
        startActivity(i);
      }
    });
    
  }
}




Java Source Code List

com.vinit.orderplacer.CategoryList.java
com.vinit.orderplacer.CheckPin.java
com.vinit.orderplacer.CommentBox.java
com.vinit.orderplacer.CounterOnClickListener.java
com.vinit.orderplacer.DumpJSON.java
com.vinit.orderplacer.IPGetter.java
com.vinit.orderplacer.RetrieveJSON.java
com.vinit.orderplacer.RetrieveSalesmen.java
com.vinit.orderplacer.SalesApp.java
com.vinit.orderplacer.SalesHistory.java
com.vinit.orderplacer.Salesman.java
com.vinit.orderplacer.SecurityPIN.java
com.vinit.orderplacer.SummaryActivity.java