Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. /**
  2. * Add your package below. Package name can be found in the project's AndroidManifest.xml file.
  3. * This is the package name our example uses:
  4. *
  5. */
  6. package com.example.android.justjava;
  7. import android.os.Bundle;
  8. import android.support.v7.app.AppCompatActivity;
  9. import android.view.View;
  10. import android.widget.TextView;
  11.  
  12. /**
  13. * This app displays an order form to order coffee.
  14. */
  15. public class MainActivity extends AppCompatActivity {
  16.  
  17. @Override
  18. protected void onCreate(Bundle savedInstanceState) {
  19. super.onCreate(savedInstanceState);
  20. setContentView(R.layout.activity_main);
  21. }
  22.  
  23. /**
  24. * This method is called when the order button is clicked.
  25. */
  26. public void submitOrder(View view) {
  27. display(1);
  28. }
  29.  
  30. /**
  31. * This method displays the given quantity value on the screen.
  32. */
  33. private void display(int number) {
  34. TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);
  35. quantityTextView.setText("" + number);
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement