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 this code using phonegap and jquerymobile $( '#user_detail' ).live( 'pageinit',function(event)
Right now I have this code: int number = 0; DirectoryInfo di = new
Right now to populate my GridViews I'm using a extended BaseAdapter class on each
Right now i am using the ArrayList for My ListView and there is a
Right now I am trying to design an Android app where a critical feature
Right now I can call a method using ajax (:remote=> 'true') at awisprotect_path by
Right now, I am using the ALAssetsLibrary to gather the photos from ALAssetsGroupSavedPhotos and
Right now I am using JPA. What I would like to know is the
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

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.