Android setTypeface not working correctly -
I write simple new application in Android and I want to do the activity widget using setTypeface.
The code below in this code looks right that I get this error in the console:
1803-1803 / com.example.AndroidMultiPage E / AndroidRuntime ?? Fatal exception: main java.lang.RuntimeException: Unable to start activity ComponentInfo {com.example.AndroidMultiPage / com.example.AndroidMultiPage.MyActivity}: java.lang.RuntimeException: Can not make native typeface font path: property / font / bZar.ttf my simple code:
package com.example.AndroidMultiPage; Import android App Import android.content.DialogInterface; Import android.content.Intent; Import Android.graphics. Typefaces; Importroid.os.Bundle; Import android.text.TextUtils; Import android.view.Menu; Import android.view.MenuItem; Import android.view.View; Import android.widget.Button; Import android.widget.EditText; Import android.widget.TextView; Import android.widget.Toast; Import org.w3c.dom.Text; Public Class MyActivity Extension Activity (Submit Private Button; / ** * Called On When To Have First Activity *. * / @ Override Crate On Public Zero (Bundle Saved Instantstate) {SuperContait (Saved InstantState); setContentView ( R.layout.main); Typeface face = typeface.SetForms (getAssets (), "font / bazar.tttf"); button submit = (button) findViewById (R.id.submitButton); submit.setTypeface (face);}
property f Try placing the typeface file in the folder and try using a different font file.
Comments
Post a Comment