Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to convert android edittext into java string builder. that's why i used following code in
android program.
name11 = (EditText) findViewById(R.id.name1);
		name22 = (EditText) findViewById(R.id.name2);
               n1 = new StringBuffer((String)String.valueOf(name11));
	n2 = new StringBuffer((String)String.valueOf(name22));

but it not return expected value please help.
Posted

1 solution

first convert the value of EditText in String

String s=name11.getText().toString();
String s2=name22.getText().toString();

Now create String Buffer

StringBuffer str=new StringBuffer();

str.append(s);
str.append(s2);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900