// Path: app/src/main/java/com/wiseass/profiler/util/ActivityUtils.java
// public class ActivityUtils extends AppCompatActivity {
// 
//     /**
//      * The {@code fragment} is added to the container view with id {@code frameId}. The operation is
//      * performed by the {@code fragmentManager}.
//      *
//      */
//     public static void addFragmentToActivity (FragmentManager fragmentManager,
//                                               Fragment fragment,
//                                               int frameId,
//                                               String tag) {
// 
//         FragmentTransaction transaction = fragmentManager.beginTransaction();
//         transaction.replace(frameId, fragment, tag);
//         transaction.commit();
//     }
// 
// }


import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.wiseass.profiler.R;
import com.wiseass.profiler.util.ActivityUtils;
package com.wiseass.profiler.profiledetail;



public class ProfileDetailActivity extends AppCompatActivity {
    private static final String DETAIL_FRAGMENT = "DETAIL_FRAGMENT";

    private FragmentManager manager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_profile_detail);

        manager = this.getFragmentManager();

        ProfileDetailFragment fragment = (ProfileDetailFragment) manager.findFragmentByTag(DETAIL_FRAGMENT);

        if (fragment == null){
            fragment = ProfileDetailFragment.newInstance();
        }

// Path: app/src/main/java/com/wiseass/profiler/util/ActivityUtils.java
// public class ActivityUtils extends AppCompatActivity {
// 
//     /**
//      * The {@code fragment} is added to the container view with id {@code frameId}. The operation is
//      * performed by the {@code fragmentManager}.
//      *
//      */
//     public static void addFragmentToActivity (FragmentManager fragmentManager,
//                                               Fragment fragment,
//                                               int frameId,
//                                               String tag) {
// 
//         FragmentTransaction transaction = fragmentManager.beginTransaction();
//         transaction.replace(frameId, fragment, tag);
//         transaction.commit();
//     }
// 
// }


// Path: app/src/main/java/com/wiseass/profiler/profiledetail/ProfileDetailActivity.java
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.wiseass.profiler.R;
import com.wiseass.profiler.util.ActivityUtils;

package com.wiseass.profiler.profiledetail;



public class ProfileDetailActivity extends AppCompatActivity {
    private static final String DETAIL_FRAGMENT = "DETAIL_FRAGMENT";

    private FragmentManager manager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_profile_detail);

        manager = this.getFragmentManager();

        ProfileDetailFragment fragment = (ProfileDetailFragment) manager.findFragmentByTag(DETAIL_FRAGMENT);

        if (fragment == null){
            fragment = ProfileDetailFragment.newInstance();
        }

        ActivityUtils.addFragmentToActivity(manager,