Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3317062
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:32:36+00:00 2026-05-17T22:32:36+00:00

So right now I’m using the zxing barcode scanner in my app. Here is

  • 0

So right now I’m using the zxing barcode scanner in my app. Here is example code(generic):

if(position == 0){
            Intent intent = new Intent("com.google.zxing.client.android.SCAN");
            intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
            startActivityForResult(intent, 0);


        }

public void onActivityResult(int requestCode, int resultCode, Intent intent) {
        if (requestCode == 0) {
            if (resultCode == RESULT_OK) {
                contents = intent.getStringExtra("SCAN_RESULT");
                format = intent.getStringExtra("SCAN_RESULT_FORMAT");
                // Handle successful scan
                Intent i = new Intent(Main.this, BarcodeScanner.class);
                startActivity(i);
            } else if (resultCode == RESULT_CANCELED) {
                // Handle cancel
            }
        }
    }

So when launching the BarcodeScanner.class, I also want to pass contents into it. How would I go about doing that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:32:36+00:00Added an answer on May 17, 2026 at 10:32 pm

    Use Bundle inside intents to pass data from one activity to the other. In your case, you would have to do something like –

            Intent intent = new Intent(Main.this,BarcodeScanner.class);
    
            //load the intent with a key "content" and assign it's value to content            
            intent.putExtra("content",contents);
    
            //launch the BarcodeScanner activity and send the intent along with it
            //note that content  is passed in as well             
            startActivity(intent);
    

    The information is stored in a ‘Bundle’ object that lives inside the Intent – the Bundle is created when you call the putExtras() method of the Intent object

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right Now I am making a twitter app and I am Using IFTweetLabel. I
Right now I am listing all of a users microposts using the code below.
Right now, I've just some code which fetches the picture from the URL directly.
Right now I am using sqlite within a ios application, and I want to
Right now, I have three models Post, Comment and User (using Devise ) associated
Right now any new UIViewController added to my storyboard needs to have a class
Right now I have some TabItems in my App which are implicitly styled. I
right now i m using adobe live media encoder to stream live webcam video
Right now, I have basic code for moving the textfield above the keyboard when
Right now I'm using the jQuery selector $('foo+bar') . Since I already have $('foo')

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.