Converting a string to an integer (Android)
Posted
by James Rattray
on Stack Overflow
See other posts from Stack Overflow
or by James Rattray
Published on 2010-04-25T17:57:55Z
Indexed on
2010/04/25
18:03 UTC
Read the original article
Hit count: 342
I'm not 100% on how to do this so i'm asking...
May seem stupid but...
How do I convert a string into an integer?
Background info: I have a textbox I have the user enter a number into...
it then:
EditText et = (EditText) findViewById(R.id.entry1);
String hello = et.getText().toString();
gets the string 'hello'
Now I want to convert it to a integer so I can get the number they typed in -will be used later on in code...
Is there a way to get the edittext to a integer? -That would skip the middle man... If not, string to integer will be just fine...
Thanks alot,
James
© Stack Overflow or respective owner