sharedpreferences is not saving or loading my data android .please help thanks : here is my savaData and loadData method which is used to save and laod data
 public void saveData(){
        SharedPreferences sharedPreferences= getActivity().getSharedPreferences("SubjectTitle", Context.MODE_PRIVATE);
        SharedPreferences.Editor editor=sharedPreferences.edit();
        int i=0,n;
        n=addArray.size();
        for(Bunk b: addArray) {
            editor.putString("Title"+i, b.getTitle());
            editor.putInt("No_of_bunk"+i, b.getBunk_remain());
            editor.putFloat("pre_of_att"+i, b.getPrecentageAtt());
            i++;
        }
        editor.putInt("size_of_data",n);
        editor.apply();
        Toast.makeText(getActivity(),"data saved",Toast.LENGTH_SHORT).show();

    }
    public ArrayList<Bunk> loadData(){
        SharedPreferences sharedPreferences= getActivity().getSharedPreferences("SubjectTitle", Context.MODE_PRIVATE);
        int n=sharedPreferences.getInt("size_pf_data",Default);
        String loadTitle;
        int loadBunk;
        float loadAtt;
        for(int i=0;i<n;i++){
            loadTitle=sharedPreferences.getString("Title"+i,DEFAULT);
            loadBunk=sharedPreferences.getInt("No_of_bunk"+i,Default);
            loadAtt=sharedPreferences.getFloat("pre_of_att"+i,def_ault);
            addArray.add(new Bunk(loadTitle,loadBunk,loadAtt));
        }
      return addArray;
    }
here is code which is used to load data from loadData method

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup perent, Bundle savedInstanceState) {

        super.onCreateView(inflater, perent, savedInstanceState);
        View v = inflater.inflate(R.layout.fragment_main, perent, false);
            show=(ListView)v.findViewById(android.R.id.list);
        addArray=loadData();
        adapter=new BunkAdapter(addArray);
        show.setAdapter(adapter);
        return v;
    }