• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Hello all Androidists ;)

rezvani63

Lurker
Hi everybody,

My name is Masoud, I'm new to Android, but as a final semester Computer Science student, I'm doing my Final Year Project using Android, It's quite exciting for me, but at the same time difficult. So please help me on questions I ask in this forum. :)

Regards
Masoud
 
To begin let me ask a question that has taken much time for me and still I cannot solve it.
Google has a Hello ListView example of how to use ListView is Android Resources page:
List View | Android Developers

I want to change the font of TextView in this example to Tahoma.ttf

I have changed the code to below code, logically it's correct and there is no error from Eclipse, but it stops unexpectedly when I run the application! Please help me how can I do this:

public class SurahList extends ListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setFont(tv, "fonts/tahoma.ttf", R.id.SurahListTextView);
String path = "fonts/tahoma.ttf";
TextView tv=(TextView)findViewById(R.id.SurahListTextView);
Typeface font = Typeface.createFromAsset(this.getAssets(), path);
tv.setTypeface(font);

setListAdapter(new ArrayAdapter<String>(this, R.layout.main, SURAHLIST));
.....


Thanks
 
Hi everybody,

My name is Masoud, I'm new to Android, but as a final semester Computer Science student, I'm doing my Final Year Project using Android, It's quite exciting for me, but at the same time difficult. So please help me on questions I ask in this forum. :)

Regards
Masoud
Welcome to the AF forums and enjoy your visits !! :cool:
 
Back
Top Bottom