4 Replies - 423 Views - Last Post: 20 June 2013 - 10:18 PM

#1 RUAg4mer  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 30-July 11

How to: EditText and TextView on different layouts

Posted 19 June 2013 - 11:02 PM

Is it possible to have an EditText on one layout and the TextView associated with it on a different layout. The code below will post the text to the same screen. The activity I created was my first (not thought out well) attempt at getting it to jump to another page to post the text. Any suggestions?


EditText writeText;
TextView showText;
    @Override
    protected void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.enter_text_screen);
        
        Button postText=(Button) findViewById(R.id.postButton);
        
        postText.setonclickListener(new View.onclickListener() 
        {
       	 
            public void onclick(View v) 
            {
               /*Intent i = new Intent();
               i.setClassName("com.myApp" , "com.myApp.SecondScreen");
               startActivity(i);*/
               
               writeText= (EditText)findViewById(R.id.myEditText);
               showText= (TextView)findViewById(R.id.myShowText);
               showText.setText(writeText.getText().toString());
            }
        });
    }




Is This A Good Question/Topic? 0
  • +

Replies To: How to: EditText and TextView on different layouts

#2 Flukeshot  Icon User is offline

  • A little too OCD
  • member icon

Reputation: 417
  • View blog
  • Posts: 1,030
  • Joined: 14-November 12

Re: How to: EditText and TextView on different layouts

Posted 20 June 2013 - 02:29 AM

This is an android topic.

If what you mean is to have a text box and a send button that, when pressed, opens up a new activity to display the message.. Then yes it is possible and the official android tutorials teach you how.
Was This Post Helpful? 1
  • +
  • -

#3 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10772
  • View blog
  • Posts: 40,121
  • Joined: 27-December 08

Re: How to: EditText and TextView on different layouts

Posted 20 June 2013 - 10:38 AM

Moved to Android.
Was This Post Helpful? 0
  • +
  • -

#4 EndLessMind  Icon User is offline

  • These are the droids you're looking for
  • member icon

Reputation: 194
  • View blog
  • Posts: 1,099
  • Joined: 13-March 09

Re: How to: EditText and TextView on different layouts

Posted 20 June 2013 - 06:31 PM

Do you want to pass test from one a EditText in the first activity to a TextView in the second activity?
Was This Post Helpful? 0
  • +
  • -

#5 RUAg4mer  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 30-July 11

Re: How to: EditText and TextView on different layouts

Posted 20 June 2013 - 10:18 PM

View PostFlukeshot, on 20 June 2013 - 02:29 AM, said:

This is an android topic.

If what you mean is to have a text box and a send button that, when pressed, opens up a new activity to display the message.. Then yes it is possible and the official android tutorials teach you how.


Thank You Very Much. That helped..and got it working!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1