title: Zxing Lib is not working
body: <p>Friends I m using zxing 2.2 lib for barcode scanning.. I see the different tutorials for that.
  Firstly when I include capture activity lib in eclips. it shows error in it.. I find the solution. and add a core.jar file. error removes successfully. but when I make capture activity as library. it again shows error . which I remove by converting switch statement into if else..
  now there is no error in library. I include it in my project.. and use the code for barcode scanning.. but its not open even camera and close my app.. </p>
  
  <p>// here is my Main Activity code...</p>
  
  <pre><code>       package com.bluehorn.diamondfusion;
          import android.os.Bundle;
          import android.app.Activity;
          import android.app.AlertDialog;
          import android.content.DialogInterface;
          import android.content.Intent;
          import android.view.Menu;
          import android.view.View;
          import android.widget.Button;
  
  public class FusionMain extends Activity implements android.view.View.OnClickListener  {
  
          Button btnScan;
          @Override
          protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);   
      setContentView(R.layout.activity_main);
          btnScan=(Button)findViewById(R.id.btnScan);
          btnScan.setOnClickListener(this);
       }
  
          @Override
          public void onClick(View v) {
                  if(v== btnScan){
            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) {
                    String contents = intent.getStringExtra("SCAN_RESULT");
                    String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
                    // Handle successful scan
                     AlertDialog alert = new AlertDialog.Builder(FusionMain.this)
                     .create();
                       alert.setTitle("BarCode Result");
                       alert.setMessage(contents+"    \n        "+format);
                       alert.show();
                      }
                    else if (resultCode == RESULT_CANCELED) {
                         AlertDialog alert = new AlertDialog.Builder(FusionMain.this)
                          .create();
                       alert.setTitle("BarCode Result");
                       alert.setMessage("error  ,,,");
                       alert.show();
                    }
  
                 }
              }
      }
  </code></pre>
  
  <p>// and this is my android manefist file code</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.bluehorn.diamondfusion"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="7"
          android:targetSdkVersion="17"/&gt;
       &lt;uses-permission android:name="android.permission.CAMERA" /&gt;
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
  
          &lt;activity android:name="com.google.zxing.client.android.CaptureActivity"
             android:screenOrientation="landscape"
             android:configChanges="orientation|keyboardHidden"
             android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
             android:windowSoftInputMode="stateAlwaysHidden"&gt;
           &lt;intent-filter&gt;
             &lt;action android:name="android.intent.action.MAIN"/&gt;
             &lt;category android:name="android.intent.category.DEFAULT"/&gt;
           &lt;/intent-filter&gt;
           &lt;intent-filter&gt;
             &lt;action android:name="com.google.zxing.client.android.SCAN"/&gt;
             &lt;category android:name="android.intent.category.DEFAULT"/&gt;
           &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.bluehorn.diamondfusion.FusionMain"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>// LogCat ...</p>
  
  <pre><code>07-19 04:49:37.030: D/dalvikvm(3423): GC_EXTERNAL_ALLOC freed 50K, 51% free 2674K/5379K, external 1031K/1038K, paused 30ms
  07-19 04:49:37.060: D/dalvikvm(3423): GC_EXTERNAL_ALLOC freed 3K, 51% free 2676K/5379K, external 1241K/1298K, paused 10ms
  07-19 04:49:41.490: W/IInputConnectionWrapper(3423): showStatusIcon on inactive InputConnection
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to resolve static field 1322 (ISSUE_NUMBER) in Lcom/google/zxing/ResultMetadataType;
  07-19 04:49:44.880: D/dalvikvm(3423): VFY: replacing opcode 0x62 at 0x0017
  07-19 04:49:44.880: D/dalvikvm(3423): VFY: dead code 0x0019-0025 in Lcom/google/zxing/client/android/CaptureActivity;.&lt;clinit&gt; ()V
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/ResultPoint;)
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/ResultPoint;)
  07-19 04:49:44.880: I/dalvikvm(3423): Could not find method com.google.zxing.ResultPoint.getX, referenced from method com.google.zxing.client.android.CaptureActivity.drawLine
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to resolve virtual method 4441: Lcom/google/zxing/ResultPoint;.getX ()F
  07-19 04:49:44.880: D/dalvikvm(3423): VFY: replacing opcode 0x6e at 0x0004
  07-19 04:49:44.880: D/dalvikvm(3423): VFY: dead code 0x0007-0020 in Lcom/google/zxing/client/android/CaptureActivity;.drawLine (Landroid/graphics/Canvas;Landroid/graphics/Paint;Lcom/google/zxing/ResultPoint;Lcom/google/zxing/ResultPoint;F)V
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: I/dalvikvm(3423): Could not find method com.google.zxing.Result.getResultPoints, referenced from method com.google.zxing.client.android.CaptureActivity.drawResultPoints
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to resolve virtual method 4437: Lcom/google/zxing/Result;.getResultPoints ()[Lcom/google/zxing/ResultPoint;
  07-19 04:49:44.880: D/dalvikvm(3423): VFY: replacing opcode 0x6e at 0x0003
  07-19 04:49:44.880: D/dalvikvm(3423): VFY: dead code 0x0006-0070 in Lcom/google/zxing/client/android/CaptureActivity;.drawResultPoints (Landroid/graphics/Bitmap;FLcom/google/zxing/Result;)V
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: I/dalvikvm(3423): Could not find method com.google.zxing.Result.toString, referenced from method com.google.zxing.client.android.CaptureActivity.handleDecodeExternally
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to resolve virtual method 4440: Lcom/google/zxing/Result;.toString ()Ljava/lang/String;
  07-19 04:49:44.880: D/dalvikvm(3423): VFY: replacing opcode 0x74 at 0x00c9
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: D/dalvikvm(3423): VFY: dead code 0x00cc-0169 in Lcom/google/zxing/client/android/CaptureActivity;.handleDecodeExternally (Lcom/google/zxing/Result;Lcom/google/zxing/client/android/result/ResultHandler;Landroid/graphics/Bitmap;)V
  07-19 04:49:44.880: D/dalvikvm(3423): VFY: dead code 0x0187-01a5 in Lcom/google/zxing/client/android/CaptureActivity;.handleDecodeExternally (Lcom/google/zxing/Result;Lcom/google/zxing/client/android/result/ResultHandler;Landroid/graphics/Bitmap;)V
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: I/dalvikvm(3423): Could not find method com.google.zxing.Result.getBarcodeFormat, referenced from method com.google.zxing.client.android.CaptureActivity.handleDecodeInternally
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to resolve virtual method 4434: Lcom/google/zxing/Result;.getBarcodeFormat ()Lcom/google/zxing/BarcodeFormat;
  07-19 04:49:44.880: D/dalvikvm(3423): VFY: replacing opcode 0x74 at 0x004a
  07-19 04:49:44.880: D/dalvikvm(3423): VFY: dead code 0x004d-01b3 in Lcom/google/zxing/client/android/CaptureActivity;.handleDecodeInternally (Lcom/google/zxing/Result;Lcom/google/zxing/client/android/result/ResultHandler;Landroid/graphics/Bitmap;)V
  07-19 04:49:44.880: D/dalvikvm(3423): VFY: dead code 0x01bb-022a in Lcom/google/zxing/client/android/CaptureActivity;.handleDecodeInternally (Lcom/google/zxing/Result;Lcom/google/zxing/client/android/result/ResultHandler;Landroid/graphics/Bitmap;)V
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: I/dalvikvm(3423): Could not find method com.google.zxing.Result.getText, referenced from method com.google.zxing.client.android.CaptureActivity.handleDecode
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to resolve virtual method 4438: Lcom/google/zxing/Result;.getText ()Ljava/lang/String;
  07-19 04:49:44.880: D/dalvikvm(3423): VFY: replacing opcode 0x6e at 0x006f
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: D/dalvikvm(3423): VFY: dead code 0x0072-0091 in Lcom/google/zxing/client/android/CaptureActivity;.handleDecode (Lcom/google/zxing/Result;Landroid/graphics/Bitmap;F)V
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: W/dalvikvm(3423): VFY: unable to find class referenced in signature (Lcom/google/zxing/Result;)
  07-19 04:49:44.880: W/dalvikvm(3423): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/google/zxing/client/android/CaptureActivity;
  07-19 04:49:44.880: W/dalvikvm(3423): Class init failed in newInstance call (Lcom/google/zxing/client/android/CaptureActivity;)
  07-19 04:49:44.880: D/AndroidRuntime(3423): Shutting down VM
  07-19 04:49:44.880: W/dalvikvm(3423): threadid=1: thread exiting with uncaught exception (group=0xb3f8c4f0)
  07-19 04:49:44.880: D/AndroidRuntime(3423): procName from cmdline: com.bluehorn.diamondfusion
  07-19 04:49:44.880: E/AndroidRuntime(3423): in writeCrashedAppName, pkgName :com.bluehorn.diamondfusion
  07-19 04:49:44.880: D/AndroidRuntime(3423): file written successfully with content: com.bluehorn.diamondfusion StringBuffer : ;com.bluehorn.diamondfusion
  07-19 04:49:44.890: I/Process(3423): Sending signal. PID: 3423 SIG: 9
  07-19 04:49:44.890: E/AndroidRuntime(3423): FATAL EXCEPTION: main
  07-19 04:49:44.890: E/AndroidRuntime(3423): java.lang.ExceptionInInitializerError
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at java.lang.Class.newInstanceImpl(Native Method)
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at java.lang.Class.newInstance(Class.java:1409)
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at android.os.Handler.dispatchMessage(Handler.java:99)
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at android.os.Looper.loop(Looper.java:130)
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at android.app.ActivityThread.main(ActivityThread.java:3683)
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at java.lang.reflect.Method.invokeNative(Native Method)
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at java.lang.reflect.Method.invoke(Method.java:507)
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:638)
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at dalvik.system.NativeStart.main(Native Method)
  07-19 04:49:44.890: E/AndroidRuntime(3423): Caused by: java.lang.NoClassDefFoundError: com.google.zxing.ResultMetadataType
  07-19 04:49:44.890: E/AndroidRuntime(3423):     at com.google.zxing.client.android.CaptureActivity.&lt;clinit&gt;(CaptureActivity.java:97)
  07-19 04:49:44.890: E/AndroidRuntime(3423):     ... 15 more
  </code></pre>