I am developing my app with Maven build tool.. In my assets folder I have fonts/DroidSansFallback.ttf..
And my activity_main.xml is:--
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bck54"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="99dp"
android:layout_marginTop="78dp"
android:text="hello world" />
</RelativeLayout>
and my HelloAndroidActivity.java is:--
public class HelloAndroidActivity extends Activity {
TextView tv;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Typeface tf = Typeface.createFromAsset(getAssets(),
"fonts/DroidSansFallback.ttf");
tv = (TextView) findViewById(R.id.textView1);
tv.setTypeface(tf);
}
}
Here I want to change my text fonts..But the app is stopped.. My logcat error is:--
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.arijit.patra.love/com.arijit.patra.love.HelloAndroidActivity}: java.lang.RuntimeException: native typeface cannot be made
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2346)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2398)
at android.app.ActivityThread.access$800(ActivityThread.java:159)
Can anyone tell me where is the problem??