I have downloaded the ZXing project from the http://code.google.com/p/zxing/downloads/detail?name=ZXing-2.0.zip&can=2&q= and followed all the steps of http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/.
But my ZXing project is giving error in switch cases of ZXing Library.
Error is in following code
private final Handler handler = new Handler() {
    @Override
    public void handleMessage(Message message) {
      switch (message.what) {
        case R.id.search_book_contents_succeeded:
          handleSearchResults((JSONObject) message.obj);
          resetForNewQuery();
          break;
        case R.id.search_book_contents_failed:
          resetForNewQuery();
          headerView.setText(R.string.msg_sbc_failed);
          break;
      }
    }
  };
error is in switch statement error is "case expressions must be constant expressions"
Any Idea ? Thanxs
You need to convert the case statements to if statements if you compile zxing as a library. Select the text in eclipse and use ctrl+1 to let eclipse do this for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With