charlest
charlest

Reputation: 935

zxing is generating a QR code instead of a Bar Code

I am using zxing 2.0. I'm trying to create a Bar code, but instead it's creating a QR code. Here's what I'm using:

Context context = getActivity();
Intent intent = new Intent(context, EncodeActivity.class);
intent.setAction(Intents.Encode.ACTION);
intent.putExtra(Intents.Encode.TYPE, Contents.Type.TEXT);
intent.putExtra(Intents.Encode.DATA, "12345678901"); 
intent.putExtra(Intents.Encode.FORMAT, BarcodeFormat.UPC_A);
startActivity(intent);

Upvotes: 1

Views: 1587

Answers (1)

TryTryAgain
TryTryAgain

Reputation: 7820

Instead of

intent.putExtra(Intents.Encode.FORMAT, BarcodeFormat.UPC_A);

and all the other intent.putExtra(Intents.Encode.*

try

Context context = getActivity();
Intent intent = new Intent("com.google.zxing.client.android.ENCODE");
    intent.putExtra("ENCODE_TYPE", Text);
    intent.putExtra("ENCODE_DATA", "12345678901");
    intent.putExtra("ENCODE_FORMAT", "UPC_A");
    startActivity(intent);

Upvotes: 3

Related Questions