#StackBounty: #java #android #android-activity #barcode-scanner Strange issue with intent startActivity causing my scanner to not work …

Bounty: 50

So, after I finish my scanner activity with

      btn_take_photo.setOnClickListener(new FloatingActionButton.OnClickListener() {
        @Override
        public void onClick(View view) {
            String carde = cardnumberbox.getText().toString().trim();
            if (carde.matches("")) {
                Toast.makeText(getApplicationContext(), getString(R.string.Skan_Udfyld_Kort_Nummer), Toast.LENGTH_SHORT).show();
                cardnumberbox.requestFocus();
                return;
            }
            Intent i = new Intent(ScanActivity.this, CameraActivity.class);
            i.putExtra("EXTRA_SESSION_ID", carde);
            startActivity(i);

        }
    });

to go to my cam activity so I can take some pictures and go back with

    public void btn_aprove2(View view) {
    Intent i = new Intent(CameraActivity.this, ScanActivity.class);
    String counts = count.getText().toString().trim();
    i.putExtra("EXTRA_SESSION_IDs", counts);
    String carde = cardnumberbox2.getText().toString().trim();
    i.putExtra("EXTRA_SESSION_ID", carde);
    startActivity(i);
    finish();

to the scanneractivity again. My scanner does not work properly
but if I then press the back button it does go back to the scanneractivity again instead of my menu so it seems like the scanneractivity is running twice and only 1 of them are functional but is here where it confuses me

cause if do not press the btn_aprove2 button and just use the back button instead
i gets the exact same issue but here my scanneractivity is not runned twice as when i press the back button it just takes me back to the menu

a video of the issue

by removing my screen orientation from the manifest (so i can rotate it)
my scanner do now work but only if i first rotate to landscape and rotate it back to potrait

I am totally lost on how to get this to work.

on github with api demo and documentation in the wiki and with thoose classes that are being used


Get this bounty!!!