0
I have a Textview to which I use a String as the text, I wanted to know if it is possible through a click to change this String(text) to a new text that is typed.
public class Texto extends Activity {
TextView Txtmessage;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate( savedInstanceState );
setContentView( R.layout.texto );
Txtmessage = (TextView) findViewById( R.id.EdtMensagemCalendar );
Txtmessage.setText( Txt );
Txtmessage.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View v) {
}
} );
}
I wanted to know if inside Onclick I can create an option for the user to type the message you want and so change the String(Txt).
Yes. You create a dialog that will be created and displayed by clicking on Textmessage. In this dialog there is a button and a textEdit. The user informs the text and clicks on the button and at that time you change the text.
– Reginaldo Rigo
Thank you. What would that code look like?
– user116985