Here is my activity's code
public class MainActivity extends Activity {
String height, weight;
String dob, dov;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final Button button = (Button) findViewById(R.id.button1);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
enterClicked();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void enterClicked()
{
height = ((EditText) findViewById(R.id.editText1)).getText().toString();
weight = ((EditText) findViewById(R.id.editText2)).getText().toString();
System.out.println( height + " " + weight );
}
}
When I run this code on the emulator I want it to take in the text I input and when I click the button I want it to retrieve the text and print it in the log. It doesn't currently print. I don't have any pre-compile errors and it appears my links to my EditTexts are successful. What might be the issue?