package net.ddns.mahaljsp.ch14_01_fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

/**
 * Created by Administrator on 2016/12/7.
 */

public class FragmentB extends Fragment {
    private ImageView img;
    private View view;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view= inflater.inflate(R.layout.fragment_b, container, false);
        processViews();
        processControllers();
        return view;
    }
    public void processViews(){
        img=(ImageView)view.findViewById(R.id.imageView);
    }
    public void processControllers(){
        img.setImageResource(((MainActivity)getActivity()).getPicture());
    }
}
