This is the code that I used, but every time I turn it on, I need to stop. note that i use it on android 2.1
package com.arb;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import android.content.res.AssetManager;
import android.graphics.Typeface;
public class arabi extends Activity
{
AssetManager arabi_font;
TextView tx;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tx=(TextView) this.findViewById(R.id.tt);
try{
arabi_font.open("DejaVuSans.ttf");
tx.setTypeface(Typeface.createFromAsset(arabi_font,"DejaVuSans.ttf"));
tx.setText("\uFEB3\uFE92\uFE98\uFE94");
}
catch(Exception ex){
}
}
}
source
share