Link to home
Create AccountLog in
Avatar of Dale Harris
Dale HarrisFlag for United States of America

asked on

Android Development: Simple textbox with submit button

I've created my textbox and my submit button on the main.xml.

I'm trying to store the textbox value (in this case, let's make it someone's name) after hitting the button to a string variable.

Whenever I try to create the entry though, it makes it an integer even though I'm finding it under R.string.someonesname

Any  help?
Avatar of Dale Harris
Dale Harris
Flag of United States of America image

ASKER

This is what I have so far:

        Button button = (Button) findViewById(R.id.button1);
    	button.setOnClickListener(new onClick() {
    		@Override
    	   public void onClick(View v) {
    	      // button 1 was clicked!

Open in new window


It's giving me a lot of errors in the way that I'm using it.  It can store the button, no problem, but when I try to set the onclicklistener, that's what it bombs out.

In my tests, I was able to set the textbox value, but the button is not being "clicked" to do anything.
ASKER CERTIFIED SOLUTION
Avatar of Dale Harris
Dale Harris
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
This is harder than it looks people...