Hello all Androidists ;)


Last Updated:

  1. rezvani63

    rezvani63 New Member This Topic's Starter

    Joined:
    Jan 2, 2010
    Messages:
    2
    Likes Received:
    0
    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
     

    Advertisement
  2. rezvani63

    rezvani63 New Member This Topic's Starter

    Joined:
    Jan 2, 2010
    Messages:
    2
    Likes Received:
    0
    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
     
  3. justjimjpc

    justjimjpc Premium Member VIP Member

    Joined:
    Nov 3, 2008
    Messages:
    10,543
    Likes Received:
    210
    Welcome to the AF forums and enjoy your visits !! :cool:
     
  4. bigdroid

    bigdroid Well-Known Member

    Joined:
    Oct 31, 2009
    Messages:
    7,112
    Likes Received:
    132
    Welcome to Android Forums!! :)
     

Share This Page

Loading...