1. Download our Official Android App: Forums for Android!

Hello all Androidists ;)

Discussion in 'Introductions' started by rezvani63, Feb 28, 2010.

  1. rezvani63

    rezvani63 Lurker
    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    2
    Joined:
    Jan 2, 2010

    Jan 2, 2010
    2
    0
    25
    Student :)
    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 Lurker
    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    2
    Joined:
    Jan 2, 2010

    Jan 2, 2010
    2
    0
    25
    Student :)
    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
    Rank:
    None
    Points:
    663
    Posts:
    10,543
    Joined:
    Nov 3, 2008

    Nov 3, 2008
    10,543
    210
    663
    Washington DC, USA
    Welcome to the AF forums and enjoy your visits !! :cool:
     
  4. bigdroid

    bigdroid Android Expert
    Rank:
     #106
    Points:
    263
    Posts:
    7,118
    Joined:
    Oct 31, 2009

    Oct 31, 2009
    7,118
    138
    263
    Male
    Campus Safety Officer
    Earlville, NY
    Welcome to Android Forums!! :)
     

Share This Page

Loading...