title: QR code scanner android, onActivityResult method not calling and Toast doesn't display
body: <p>I am developing an application that involves QR scanning. I am able to execute the scanner application library  which is called from my application.After scanning i need to store the captured value,but onActivityResult method which is written inside my application is not getting called.Please help on this 
  I am posting code here:</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      Intent intent = new Intent(MainActivity.this, CaptureActivity.class);
      // Intent intent = new
      // Intent("com.google.zxing.client.android.SCAN");
      intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
      startActivityForResult(intent, 0);
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  
  public void onActivityResult(int requestCode, int resultCode, Intent intent) {
      if (requestCode == 0) {
          if (resultCode == 1) {
              // Handle successful scan
              String capturedQrValue = intent.getStringExtra("RESULT");
              // String format =
              intent.getStringExtra("SCAN_RESULT_FORMAT");
  
              Toast.makeText(MainActivity.this,"Scan Result:" + capturedQrValue, Toast.LENGTH_SHORT).show();
              finish();
              Intent it = new Intent(MainActivity.this, ThirdActivity.class);
              it.putExtra("Code", capturedQrValue);
              startActivity(it);
  
          } else if (resultCode == RESULT_CANCELED) {
              // Handle cancel
          }
  </code></pre>