1

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);
charlest
  • 925
  • 2
  • 10
  • 20

1 Answers1

3

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);
TryTryAgain
  • 7,632
  • 11
  • 46
  • 82
  • 1
    Thanks! That's exactly what I needed. I was able to remove the setAction also. – charlest Apr 02 '12 at 05:33
  • Btw trytryagain, this was extremely helpful. Is there some way I can get you more points? I clicked on the green check icon. – charlest Apr 08 '12 at 11:12
  • @TryTryAgain, hi I wonder, how do u derive "ENCODE_TYPE" or "ENCODE_DATA" please? Because I didn't find getInt() for those in ZXing's Encode Package. Thank you :) – Thet Mon Aye May 08 '12 at 03:00
  • @ThetMonAye you should ask a new question with the problem you are having. – TryTryAgain May 08 '12 at 04:38
  • @TryTryAgain, I realized that I cant ask question anymore... cos I got too many down votes :( but anyway I will be appreciate if you can answer though. – Thet Mon Aye May 13 '12 at 01:24
  • @ThetMonAye unfortunately, I'm not even sure how to help...And we are not allowed to carry on conversation/diagnosing/troubleshooting in comments, sorry. Good luck... http://code.google.com/p/zxing/wiki/BarcodeContents & http://code.google.com/p/zxing/w/list Also, mentioning your question ban on meta.stackoverflow.com may be helpful. I don't see anything that shows too much downvoting on you or anything else you shouldn't be able to get help with: http://meta.stackexchange.com/questions/86997/what-can-i-do-when-getting-sorry-we-are-no-longer-accepting-questions-answers – TryTryAgain May 13 '12 at 01:39