Q: QR Scanner: Force close(unable to instanciate activity componet) I am trying to make a small qr code scanner that makes use of classes from the Zxing libary. My code seems to be fine and I cant identify any obvious errors. When I try to run it, the app force closes.
Here is the logcat:
01-25 07:07:30.263: E/AndroidRuntime(5530): FATAL EXCEPTION: main
01-25 07:07:30.263: E/AndroidRuntime(5530): 
java.lang.RuntimeException: Unable to instantiate activity 
ComponentInfo
{zeero.damian.qrcodescanner/zeero.damian.qrcodescanner.QR_Scanner}: 
java.lang.ClassNotFoundException: 
zeero.damian.qrcodescanner.QR_Scanner in loader 
dalvik.system.PathClassLoader[/data/app/zeero.damian.qrcodescanner-
2.apk]
01-25 07:07:30.263: E/AndroidRuntime(5530):     at 
android.app.ActivityThread.performLaunchActivity
(ActivityThread.java:1618)
01-25 07:07:30.263: E/AndroidRuntime(5530): at 
android.app.ActivityThread.handleLaunchActivity
(ActivityThread.java:1716)
01-25 07:07:30.263: E/AndroidRuntime(5530):     at 
android.app.ActivityThread.access$1500(ActivityThread.java:124)
01-25 07:07:30.263: E/AndroidRuntime(5530):     at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:968)
01-25 07:07:30.263: E/AndroidRuntime(5530):     at 
android.os.Handler.dispatchMessage(Handler.java:99)
01-25 07:07:30.263: E/AndroidRuntime(5530):     at 
android.os.Looper.loop(Looper.java:130)
01-25 07:07:30.263: E/AndroidRuntime(5530):     at 
android.app.ActivityThread.main(ActivityThread.java:3806)
01-25 07:07:30.263: E/AndroidRuntime(5530):     at 
java.lang.reflect.Method.invokeNative(Native Method)
01-25 07:07:30.263: E/AndroidRuntime(5530):     at 
java.lang.reflect.Method.invoke(Method.java:507)
01-25 07:07:30.263: E/AndroidRuntime(5530):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:839)
01-25 07:07:30.263: E/AndroidRuntime(5530):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
01-25 07:07:30.263: E/AndroidRuntime(5530):     at 
dalvik.system.NativeStart.main(Native Method)
01-25 07:07:30.263: E/AndroidRuntime(5530): Caused by: 
java.lang.ClassNotFoundException: 
zeero.damian.qrcodescanner.QR_Scanner in loader 
dalvik.system.PathClassLoader[/data/app/zeero.damian.qrcodescanner-
2.apk]
01-25 07:07:30.263: E/AndroidRuntime(5530):     at 
dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
01-25 07:07:30.263: E/AndroidRuntime(5530):     at 
java.lang.ClassLoader.loadClass(ClassLoader.java:551)
01-25 07:07:30.263: E/AndroidRuntime(5530):     at 
java.lang.ClassLoader.loadClass(ClassLoader.java:511)
01-25 07:07:30.263: E/AndroidRuntime(5530):     at 
android.app.Instrumentation.newActivity(Instrumentation.java:1021)
01-25 07:07:30.263: E/AndroidRuntime(5530):     at 
android.app.ActivityThread.performLaunchActivity
(ActivityThread.java:1610)
01-25 07:07:30.263: E/AndroidRuntime(5530):     ... 11 more
01-25 07:07:30.263: W/ActivityManager(1468):   Force finishing 
activity zeero.damian.qrcodescanner/.QR_Scanner
01-25 07:07:30.423: E/NetlinkEvent(1351): NetlinkEvent::FindParam(): 
Parameter 'UDEV_LOG' not found

And here is my MainActivity class
package zeero.damian.qrscanner;

import zeero.damian.qrcodescanner.R;

import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;

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

public class MainActivity extends Activity implements OnClickListener {

private Button scanBtn;
private TextView formatTxt;
private TextView contentTxt;

public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_activity);

    scanBtn = (Button)findViewById(R.id.scan_button);
    formatTxt = (TextView)findViewById(R.id.scan_format);
    contentTxt = (TextView)findViewById(R.id.scan_content);

    scanBtn.setOnClickListener(this);
}
// Press the scan button to begin //
public void onClick(View v){
    if(v.getId()==R.id.scan_button){
        IntentIntegrator scanIntegrator = new IntentIntegrator(this);
        scanIntegrator.initiateScan();
    }
}

public void onActivityResult(int requestCode, int resultCode, Intent intent){
    IntentResult scanningResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);

    if(scanningResult != null){

        /*
         * If scan is successful any code here will be executed,
         * here the app will display the code format, and any
         * Information it holds. This can be added to or replaced
         * to do something else on a successful scan.
         */

        String scanContent = scanningResult.getContents();
        String scanFormat = scanningResult.getFormatName();

        formatTxt.setText("FORMAT: " + scanFormat);
        contentTxt.setText("CONTENT: " + scanContent);
    }

    else{

        /*
         * if the code scan fails, this block will be executed. 
         * Here a pop up alert will alert the user that the scan 
         * was unsuccessful, but like above, this can be changed to
         * whatever you want it to do.
         */

        Toast toast = Toast.makeText(getApplicationContext(), 
                "Scan was unsuccessful!"+ "\n" + 
                "Please try again...", Toast.LENGTH_SHORT);
        toast.show();
    }
}

}

A: The exception indicates that you are trying to start an Activity called zeero.damian.qrcodescanner.QR_Scanner somewhere. I don't see this in the code you posted, but a common cause of this exception is forgetting to register the Activity in your Manifest
