I am new to android development, I have created a string variable with EditText ,how can i assign that string to another string. thanks in advance.
2 Answers
have you tried: "="?
i.e.:-
String oldString = "odl Text";
String newString = oldString;
Simple steps can be:
- get text from EditText as string
- assign that to some other string variable.
Provide some more information to get better solutions. What problem are you facing?
21 Comments
sujay
actually i wanted the value of the string to be assigned to another string
Harry Joy
@sameer: Whats the problem in that? Use
= operator to do this.sujay
here is my code txtpassword=(EditText)findViewById(R.id.Editpassword); String strEditText; strEditText=txtpassword.text; if(txtpassword==AdminPwdHandler.strCurrentPassword). here strCurrentPassword is a string variable from another class
Harry Joy
@sameer: do you get any error while running this? see log cat to know if error comes or not.
sujay
ya i am getting the following error.. incompatible operands EditText and String
|