zxing-android-embedded
zxing-android-embedded copied to clipboard
How to intentIntegrator to get result form fragment that i run from getSupportFragmentManager commit
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();