Qr code reader does not redirects to specific link
<p>I am creating a qr code reader application and I took help from the zXing resource and after running my application on my phone it says "Found URL" and does not redirect me to the specific link of the qr code. It takes me back to my main activity.
My project name is "scan" and I have added the core.jar file. I also have one layout page i.e main.xml with a button named "scan qr code" and the activity name is "ScanActvity.java" the whole coding of my project is as:</p>

<p><strong>ScanActivity.java</strong></p>

<pre><code>package com.scan.qr;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class ScanActivity extends Activity {
/** Called when the activity is first created. */
Button btnScan;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    btnScan = (Button) findViewById(R.id.button1);

    btnScan.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub

            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
              } else if (resultCode == RESULT_CANCELED) {
                 // Handle cancel
              }
           }
        }                  
          }
</code></pre>

<p><strong>main.xml</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" &gt;


&lt;RelativeLayout
    android:id="@+id/relativeLayout1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" &gt;



    &lt;Button
        android:id="@+id/button1"
        android:layout_width="150dp"
        android:layout_height="60dp"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="Scan qr code" /&gt;

&lt;/RelativeLayout&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p><strong>ActivityMainfest.xml</strong></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.scan.qr"
 android:versionCode="1"
 android:versionName="1.0" &gt;

&lt;uses-sdk android:minSdkVersion="7" /&gt;
&lt;uses-permission android:name="android.permission.CAMERA"/&gt;

&lt;application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" &gt;
    &lt;activity
        android:name=".ScanActivity"
        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;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;/application&gt;

    &lt;/manifest&gt;
</code></pre>

<p>I have also added a folder "zcore" containing core.jar file in my project named "scan" and have added it in the properties i.e under "JavaBuildPath" added jar file named "core.jar" located in "zcore" folder of my project.</p>

<p>Now i tried to run this on emulator it gives me error message like these:</p>

<pre><code>AndroidRuntime(401): at     
com.google.zxing.client.android.camera.CameraManager.getFramingRectInPreview   
(CameraManager.java:218)

AndroidRuntime(401): at  
com.google.zxing.client.android.ViewfinderView.onDraw(ViewfinderView.java:117) 

AndroidRuntime(401): at   
com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1830)

dalvikvm(401): Unable to open stack trace file '/data/anr/traces.txt': Permission 
denied
</code></pre>

<p>and then I tried to run the apk file on my samsung galaxy y phone, it runs fine and when I click the button "scan qr code" it opens the camera and when I put image of qr code in front of camera it detects the qr code and reads it and says "Found URL" and then the main page opens up again and it does not redirects me to the specific URL. How can I figure how it will redirect me and show me the information of the qt code? Why doesn't it redirect me to the URL and why does it open the main page again after scanning a qr code?</p>

<p>Please help me out how to solve this problem! Is their anything wrong I did or is there anything to do while making an qr code reader and also please suggest me how to add filters in the qr code reader. </p>
