Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
natsirasrafi opened this issue Jul 4, 2022 · 0 comments

Comments

@natsirasrafi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant