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 have code that looks something like this: Private Sub ShowReport(ByVal reportName
Right now I am trying to use selenium ide to write code that makes
Right now I am using the following CSS: option { border-width: 1px; border-style: solid;
Right now, I'm using this fashion: window.Foo = { alpha: function() {}, bravo: function(arg)
Right now I am trying to save a variable when i close the app
right now I'm creating an array and using: render :json => @comments This would
Right now I'm stuck between using PHP's native session management, or creating my own
Right now I have to create a new physical file in eclipse android for
Right now I am writing a little c++ console program using VS2010 Express. The
Right now I have the following piece of code: RSpec::Matchers.define :include_an_html_tag do |tag| tag

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.