Assuming that you were able to build the demo android application as per my previous posts and add the main.xml with the text box buttons etc., here are the steps to add a text view and write text into it. Open res/layout/main.xml and the WYSIWYG mode drag the TextView control from the left tools column in Eclipse. In the code(XML) view mode you might see something like this.

<TextView android:id="@+id/TextView01"
android:layout_below="@+id/AnalogClock01"
android:layout_width="wrap_content"
android:text="@+id/TextView01" android:layout_height="wrap_content">
 </TextView>

Notice the id of this control, it isĀ  TextView01 in this case.

Now open your main Java class file of the applications activity and add these lines. In any of the methods as per your need.

TextView tv1 = (TextView) findViewById(R.id.TextView01);
tv1.setText("Welcome to Schogini!");

Incoming search terms:

  • add text box to android
  • in android how to user write text in text view
  • how to write the code for Textview in adnroid
  • how to insert text in android app development
  • how to add textview in alertview in ios
  • how to add text lines in andriod
  • how to add text in android app
  • append textview android
  • append text in android
  • android eclipse insert textview

Filed under: Android

Like this post? Subscribe to my RSS feed and get loads more!