package com.sheep.gamegroup.view.activity;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;

import com.sheep.gamegroup.absBase.BaseActivity;
import com.sheep.gamegroup.view.fragment.FgtPersonalCenter;
import com.sheep.jiuyan.samllsheep.R;

/**
 * 个人中心首页
 * Created by ljy on 2018/3/10.
 */

public class PersonalCenterAct extends BaseActivity {


    @Override
    protected int getLayoutId() {
        return R.layout.common_container;
    }

    @Override
    public void initView() {

        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        Bundle bundle = new Bundle();
        Fragment fragment = getSupportFragmentManager().findFragmentByTag("tag");
        if (fragment == null) {
            fragment = new FgtPersonalCenter();
            fragment.setArguments(bundle);
            transaction.add(R.id.frame_container, fragment, "tag");
            transaction.commitAllowingStateLoss();
        } else {
            fragment.setArguments(bundle);
            transaction.replace(R.id.frame_container, fragment);
            transaction.commitAllowingStateLoss();
        }

    }

}
