package kr.co.compcareworker.Fragment;

import android.content.Intent;

import androidx.fragment.app.Fragment;

import com.google.zxing.integration.android.IntentIntegrator;

public class FragmentIntentIntegrator extends IntentIntegrator {

    /**
     * Fragment 전용 IntentIntegrator
     * 기존 IntentIntegrator 는 Activity 에서 onActivityResult 를 받을수 있어서 만듬
     */

    private final Fragment fragment;

    public FragmentIntentIntegrator(Fragment fragment) {
        super(fragment.getActivity());
        this.fragment = fragment;
    }

    @Override
    protected void startActivityForResult(Intent intent, int code) {
        fragment.startActivityForResult(intent, code);
    }
}
