Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Using an Activity to perform business logic

  • Loading branch information...
commit 6271512bc11ea204b1c81407d3f76dbac3707ad4 1 parent f249786
Mike Wolfson authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 src/com/andevcon/bootcamp/MainActivity.java
View
19 src/com/andevcon/bootcamp/MainActivity.java
@@ -2,7 +2,12 @@
import android.os.Bundle;
import android.app.Activity;
+import android.text.Editable;
+import android.util.Log;
import android.view.Menu;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
public class MainActivity extends Activity {
@@ -10,6 +15,20 @@
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
+
+ final EditText expenseName = (EditText) findViewById(R.id.item_name_edittext);
+ final EditText expenseAmount = (EditText) findViewById(R.id.item_amount_edittext);
+ Button nextButton = (Button) findViewById(R.id.enter_button);
+
+ nextButton.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View v) {
+ String name = expenseName.getText().toString();
+ String amount = expenseAmount.getText().toString();
+
+ Log.v("Bootcamp", "The expense: " + name + " has the value: " + amount);
+ }
+ });
+
}
@Override
Please sign in to comment.
Something went wrong with that request. Please try again.