I’ve creating a textView called textView1 using the Layout Editor on main.xml. I want to use a custom font so I a font set line of code into the onCreate but it doesn’t seem to recongnize the name textView1
package com.mystraldesign.memorable;
import android.app.Activity;
import android.graphics.Typeface;
import android.os.Bundle;
public class MemorableActivity extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Typeface type = Typeface.createFromAsset(getAssets(),"fonts/optima.ttf");
textView1.setTypeface(type);
}
}
I’m sure I’m missing something simple but this is my first time coding Android so still feeling my way around.
1 Answer