package com.example.fragment;

import com.example.kechengbiao.MainActivity;
import com.example.kechengbiao.R;

import android.app.Activity;
import android.app.Fragment;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class Wo_SetFragment extends Fragment {


	TextView yx_text,zy_text,xh_text,xm_text;
	MainActivity activity;
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.wo_set, container, false);
		yx_text = (TextView) view.findViewById(R.id.wo_yx_text);
		zy_text = (TextView) view.findViewById(R.id.wo_zy_text);
		xh_text = (TextView) view.findViewById(R.id.wo_xh_text);
		xm_text = (TextView) view.findViewById(R.id.wo_xm_text);
		activity = (MainActivity) getActivity();
		
		setData();
		
		return view;
	}
	private void setData() {
        SharedPreferences sp = activity.getSharedPreferences("STU_DATA", Activity.MODE_PRIVATE);
		
		String yx = sp.getString("YX", "");
		String zy = sp.getString("ZY", "");
		String xh = sp.getString("XH", "");
		String xm = sp.getString("XM", "");
		yx_text.setText(yx);
		zy_text.setText(zy);
		xh_text.setText(xh);
		xm_text.setText(xm);
		
	}
	
}
