I want to do something very simple. I want when the user press the "msg" button a message appears with at least two short paragraphs just below the button, but I'm finding it difficult to put the information inside a TextView because it does not let me format the text the way I want and when I put all text inside the TextView the paragraph gets all broken. Can someone help me?
xml:
<LinerLayout
android:layout_width = "match_parent"
android:layout_height = "wrap_content"
android:background = "#ddd"
android:orientation = "vertical">
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text ="aperte!"
android:onclick = "imprimirTexto"/>
<TextView
android:id = "@+id/textoTextView"
android:layout_width ="wrap_content"
android:layout_height = "wrap content"
android:layout_gravity = "center"/>
</LinearLayout>
java
public class MainActivity extends Activity{
private TextView texto;
public void onCreate(Budle saveInstanceState){
super.onCreate(saveInstanceState);
setContentView(R.layout.main);
texto = (TextView) findViewById(R.id.textoTextView);
}
public void imprimirTexto(View v){
texto.setText("meus paragrafos ficam aqui");
}
}