Android Camera Class Crashing D: (Beginner App)
<p>My app keeps crashing when I start the Camera class.</p>

<pre><code>package com.example.tutorial;

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

public class Camera extends Activity implements View.OnClickListener {

  Button photoTaken, setWall;
ImageView actualWall;
Intent i;
final static int cameradata = 0;
Bitmap savepic;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.photo);
    initializeVar();

}

private void initializeVar() {
    // TODO Auto-generated method stub
    photoTaken = (Button) findViewById(R.id.bSet);
    setWall = (Button) findViewById(R.id.ibTake);
    actualWall = (ImageView) findViewById(R.id.ivBackground);
    photoTaken.setOnClickListener(this);
    setWall.setOnClickListener(this);
}

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub
    switch (v.getId()) {
    case R.id.bSet:

        break;

    case R.id.ibTake:
        i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
        startActivityForResult(i, cameradata);
        break;

    default:

        break;
    }
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == RESULT_OK) {
        Bundle extras = data.getExtras();
        savepic = (Bitmap) extras.get("data");
        actualWall.setImageBitmap(savepic);
    }
}
}
</code></pre>

<p>Log:</p>

<pre><code>02-01 22:51:44.144: E/MediaPlayer(14906): mOnVideoSizeChangedListener is null. Failed to send MEDIA_SET_VIDEO_SIZE message.

02-01 22:51:44.144: E/MediaPlayer(14906): mOnPreparedListener is null. Failed to send MEDIA_PREPARED message.

02-01 22:51:44.194: D/memalloc(14906): ion: Mapped buffer base:0x5bc0e000 size:1536000 offset:0 fd:45
02-01 22:51:44.214: D/CLIPBOARD(14906): Hide Clipboard dialog at Starting input: finished by someone else... !
02-01 22:51:46.376: D/memalloc(14906): ion: Mapped buffer base:0x5be98000 size:1536000 offset:0 fd:52
02-01 22:51:46.396: D/memalloc(14906): ion: Unmapping buffer  base:0x5bc0e000 size:1536000
02-01 22:51:47.517: D/memalloc(14906): ion: Mapped buffer base:0x5bb0e000 size:1536000 offset:0 fd:45
02-01 22:51:47.547: D/memalloc(14906): ion: Mapped buffer base:0x5c00f000 size:1536000 offset:0 fd:48
02-01 22:51:51.341: W/dalvikvm(14906): threadid=1: thread exiting with uncaught exception (group=0x40bc91f8)
02-01 22:51:51.341: E/AndroidRuntime(14906): FATAL EXCEPTION: main
02-01 22:51:51.341: E/AndroidRuntime(14906): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.tutorial/com.example.tutorial.Camera}: java.lang.ClassCastException: android.widget.ImageButton cannot be cast to android.widget.Button
02-01 22:51:51.341: E/AndroidRuntime(14906):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1968)
</code></pre>
