开发者

On using external font in android my Application closes autometically

开发者 https://www.devze.com 2023-02-12 06:51 出处:网络
I am trying external font in my application but Application crash automatically. I am using the code Typeface face;

I am trying external font in my application but Application crash automatically.

I am using the code

Typeface face;

face = Typeface.createFromAsset(getAssets(), "font.otf"); 

textview.setTypeface(face); 

its working but if i switch this activity more frequently then it crashes..

Give m开发者_Go百科e solution....

Please help me...


Enclose this code in try { } catch { } block and see what exception it throws. This will help you a lot. Also you can just run the app in debug mode and when it crashes, you will see the e var in the variables tab.

0

精彩评论

暂无评论...
验证码 换一张
取 消