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