Question

This question is very stupid, I just want to know how to use Custom font, in non-Activity class? cause I really don't know how to change font into non-activity class in android, this my case, i have class called :

 sma.java
 package com.example.database.search;

 import android.app.Activity;
 import android.content.Context;
 import android.graphics.Typeface;
 import android.widget.DatePicker;
 import com.example.search.text;
 public class Sma
 {

//primary key
private long id;

private String  nama;
private String alamat;

private String latitude;
private String longitude;
private int telepon;
private String  website;
private String  email;
private String  tgl_berdiri;
private String  deskripsi_keunggulan;
private String tgl_akreditasi;
private String  facebook;
private String  twitter;

@Override
public String toString()
{
   return "ID : "   + id    
   + "\n" +"Nama :" + nama 
   + "\n" + "Alamat :"+ alamat + "\n" + and so on...;
}
}

i just want to know how to using custom font into method toString()? can anyone help me? i really know this is a stupid question, but i need a tutorial in this case. and also, if somebody can give me tutorial how to change font into all activity. Thank you for helping me

Was it helpful?

Solution

i just want to know how to using custom font into method toString()?

That is not possible. A String does not have a font. Something that uses a String, like a TextView, may use a font.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top