SharedPreferences crashes my app in Studio
<p>I want to use <strong>SharedPreferences</strong> to save settings but it crashes my app! I had used it once in Eclipse.</p>

<pre><code>    SharedPreferences prefs= PreferenceManager.getDefaultSharedPreferences(this);
    String font =prefs.getString("font", "");
    int size =prefs.getInt("size", 10);
    int space =prefs.getInt("space", 7);

    final TextView txt = (TextView) findViewById(R.id.textView5);
    SeekBar seeksize = (SeekBar) findViewById(R.id.seekBar1);
    SeekBar fasele = (SeekBar) findViewById(R.id.seekBar2);

    seeksize.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

        @Override
        public void onStopTrackingTouch(SeekBar arg0) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onStartTrackingTouch(SeekBar arg0) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {
            // TODO Auto-generated method stub
            //txt1.setTextSize(arg1);
            txt.setTextSize(arg1);
        }
    });

    fasele.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

        @Override
        public void onStopTrackingTouch(SeekBar arg0) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onStartTrackingTouch(SeekBar arg0) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {
            // TODO Auto-generated method stub
            //txt1.setTextSize(arg1);
            txt.setLineSpacing(arg1,1);
        }
    });
    final Typeface zar = Typeface.createFromAsset(getAssets(), "font/BZAR.TTF");
    final Typeface nazanin = Typeface.createFromAsset(getAssets(), "font/BNAZANIN.TTF");
    final Typeface kodak = Typeface.createFromAsset(getAssets(), "font/BKOODKBD.TTF");

    RadioButton rb_nazanin = (RadioButton) findViewById(R.id.radio0);
    RadioButton rb_zar = (RadioButton) findViewById(R.id.radio1);
    RadioButton rb_kodak = (RadioButton) findViewById(R.id.radio2);


    rb_nazanin.setOnCheckedChangeListener(new OnCheckedChangeListener() {
        @SuppressLint("NewApi")
        @Override
        public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
            // TODO Auto-generated method stub
            if (arg1 == true)
            {
                txt.setTypeface(nazanin);
                SharedPreferences shared = getSharedPreferences("Prefs", MODE_PRIVATE);
                SharedPreferences.Editor editor = shared.edit();
                editor.putString("font", "nazanin");
                editor.apply();


            }
        }
    });

    rb_zar.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
            // TODO Auto-generated method stub
            if (arg1 == true)
            {
                txt.setTypeface(zar);
                SharedPreferences shared = getSharedPreferences("Prefs", MODE_PRIVATE);
                SharedPreferences.Editor editor = shared.edit();
                editor.putString("font", "zar");
                editor.apply();
            }
        }
    });

    rb_kodak.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
  // TODO Auto-generated method stub
            if (arg1 == true)
            {
                txt.setTypeface(kodak);
                SharedPreferences shared = getSharedPreferences("Prefs", MODE_PRIVATE);
                SharedPreferences.Editor editor = shared.edit();
                editor.putString("font", "kodak");
                editor.apply();
            }
        }
    });
</code></pre>

<p><strong>Logcat</strong> errors</p>

<blockquote>
  <p>03-17 02:24:46.113 1700-1700/com.example.material.testnavi
  E/AndroidRuntime: FATAL EXCEPTION: main java.lang.RuntimeException:
  Unable to start activity
  ComponentInfo{com.example.material.testnavi/com.example.material.testnavi.MainTan}:
  java.lang.RuntimeException: native typeface cannot be made at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
  at
  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
  at android.app.ActivityThread.access$600(ActivityThread.java:141) at
  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
  at android.os.Handler.dispatchMessage(Handler.java:99) at
  android.os.Looper.loop(Looper.java:137) at
  android.app.ActivityThread.main(ActivityThread.java:5041) at
  java.lang.reflect.Method.invokeNative(Native Method) at
  java.lang.reflect.Method.invoke(Method.java:511) at
  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at
  dalvik.system.NativeStart.main(Native Method) Caused by:
  java.lang.RuntimeException: native typeface cannot be made at
  android.graphics.Typeface.(Typeface.java:175) at
  android.graphics.Typeface.createFromAsset(Typeface.java:149) at
  com.example.material.testnavi.MainTan.onCreate(MainTan.java:79) at
  android.app.Activity.performCreate(Activity.java:5104) at
  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
  at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
  at
  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) 
  at android.app.ActivityThread.access$600(ActivityThread.java:141)  at
  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) 
  at android.os.Handler.dispatchMessage(Handler.java:99)  at
  android.os.Looper.loop(Looper.java:137)  at
  android.app.ActivityThread.main(ActivityThread.java:5041)  at
  java.lang.reflect.Method.invokeNative(Native Method)  at
  java.lang.reflect.Method.invoke(Method.java:511)  at
  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)  at
  dalvik.system.NativeStart.main(Native Method)</p>
</blockquote>