You can just do them in your xml by adding these to your TextView
android:text="A salamu aleykoum"
android:textSize="50sp"
android:textColor="#0000FF"
To do it programatically, you need to give your TextView an ID in your xml. In my case (activity_main.xml)
<TextView
android:id="@+id/monTexte"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Then bring your TextView and find it using findViewById
package com.example.stackoverflow;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private TextView monTexte;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
monTexte = findViewById(R.id.monTexte);
}
}
Now you can
monTexte.setText("A salamu aleykoum");
monTexte.setTextSize(50);
monTexte.setTextColor(0x0000FF);
Altogether:
package com.example.stackoverflow;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private TextView monte;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
monTexte = findViewById(R.id.monTexte);
monTexte.setText("A salamu aleykoum");
monTexte.setTextSize(50);
monTexte.setTextColor(0x0000FF);
}
}
I really hope it helps!