zxing-android-embedded icon indicating copy to clipboard operation
zxing-android-embedded copied to clipboard

How to intentIntegrator to get result form fragment that i run from getSupportFragmentManager commit

Open natsirasrafi opened this issue 3 years ago • 0 comments

in My MainActivtiy button trigger run fragment :

ScanFragment sf = new ScanFragment(); getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,sf).commit();


in my Fragment Class :

public static ScanFragment newInstance() {
	return new ScanFragment();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

	View rootView = inflater.inflate(R.layout.fragment_scan, container, false);
	barcodeView = rootView.findViewById(R.id.barcode_view);
	barcodeView.setStatusText("");
	capture = new CaptureManager(getActivity(), barcodeView);
	capture.initializeFromIntent(getActivity().getIntent(), savedInstanceState);
	capture.decode();

	return rootView;
}

if i run fragment with new IntentIntegrator(this).setCaptureActivity(TabbedScanning.class).initiateScan();

is running well , but i want run with :

    getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,sf).commit();

because i split my layout with frame layout. when i run with initiateScan() is open new page i want to process result in my mainactivity with intentintegrator

natsirasrafi avatar Jul 04 '22 06:07 natsirasrafi