ACP
ACP

Reputation: 47

Android - Best way to layout some text on an activity

I have an activity called medical and I just want to layout some text that explains what to do in a medical emergency. It will just be hard coded in, doesn't need to come from a db or anything complicated.

I current have just a textview like this:

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Do not move the patient,unless it is necessary, to reduce the risk of possible further injury"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintHorizontal_bias="0.134"
    app:layout_constraintVertical_bias="0.032" />

But I need to write it out so it looks like this:

It would be really good if I could make the link to the phone number work as well. Thanks everyone

Upvotes: 1

Views: 28

Answers (1)

Stellar Jay
Stellar Jay

Reputation: 80

You can simply add a newline character to add line breaks :)

"First Line \nSecond Line"

You can also have the control auto-detect phone numbers so long as they are in the correct format:

android:autoLink="phone"

You should also be able to use \u2022 for a bullet.

Upvotes: 3

Related Questions