views:

39

answers:

2

Do I need to create a new activity to view text written in a text box?

For example,

I want to see - "Hello"+ text written in a text box.

Thanks.

A: 

When do you want the "Hello"+ text written in a text box to appear? do you want it as a popup or do you want it to appear as the user enters text in to the Text Box in real time.

If the text box is already populated, then you can get your desired String as follows (although you should probably avoid the inline String processing):

TextView yourTextBox = (TextView) findViewById(R.id.yourTextBox);
String fromTextBox = "Hello " + textView.getText();

If you want this to appear in a popup, or on button press then just have the appropriate listner that opens a dialog box using your String.

rhinds
Yes I was actually stuck in the action handler case. I put a button to show this "Hello" + text. But its only showing me Hello.Any suggestion?
zeb
A: 
TextView2.setText("Hello" + TextView1.getText());
Jorgesys