フォントが Project の assets ディレクトリ内に配置されているかのようにコードを変更します。
Typeface type= Typeface.createFromAsset(getAssets(),"fonts/hwxk.ttf");
tv=(TextView) findViewById(R.id.index_grid_detail_text);
tv.setTypeface(type);
また、Sdcard からカスタム フォントを作成するには、コードを次のように変更します。
Typeface type= Typeface.createFromFile(new File(Environment.getExternalStorageDirectory(), "/assets/fonts/hwxk.ttf"));
tv=(TextView) findViewById(R.id.index_grid_detail_text);
tv.setTypeface(type);
ファイルに SD カードのアクセス許可を追加しAndroidManifest.xml
ます。
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />