การต่อ String ใน EditText? Home Forums General Android Application Development การต่อ String ใน EditText? tee-lex / Reader Posted on March 7, 2012 at 10:54 am Share Tweet Line ไม่ทราบว่ามีท่านใดที่เคยสร้าง Button มากกว่า1 Button แล้วเวลา Click event มัน ไปShow ใน EditText บ้างครับ(แบบเรียงต่อกันไปเรื่อย ใน EditText) ผมลองทำแล้วมันไม่ต่อให้มันจะเป็น textView ใหม่เลย ขอบคุณครับ 2 Replies Teardrop / Reader Posted on March 7, 2012 at 8:53 pmedittext ed = …. ed.settext(ed.gettext().tostring() + “newtext”);ored.gettext().append(“new text”) //แบบนี้ เร็วกว่า แต่มีช้อแม้เรื่อง cursor นะ tee-lex / Reader Posted on March 9, 2012 at 4:49 pmใช่ครับ Cursor มันไม่อยู่ข้างหลังตัวอักษรล่าสุด แต่แก้ได้แล้ว ขอบคุณครับ
edittext ed = ….
ed.settext(ed.gettext().tostring() + “newtext”);
or
ed.gettext().append(“new text”) //แบบนี้ เร็วกว่า แต่มีช้อแม้เรื่อง cursor นะ
ใช่ครับ Cursor มันไม่อยู่ข้างหลังตัวอักษรล่าสุด แต่แก้ได้แล้ว ขอบคุณครับ