Why this code produce "Sorry! The application has stopped unexpectedly. Please try again." problem?
<p>Here is the code:
public class beautiful extends Activity {
    ImageView radar = (ImageView) findViewById(R.id.radar);</p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
      this.requestWindowFeature(Window.FEATURE_NO_TITLE);
      this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.beautiful);

    Button search = (Button) findViewById(R.id.magnifier);
    ImageView text = (ImageView) findViewById(R.id.text);
    MediaPlayer siren = MediaPlayer.create(this, R.raw.siren);

    search.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            Thread counter = new Thread(new Runnable(){

                @Override
                public void run() {
                    // TODO Auto-generated method stub
                    try{
                        Thread.sleep(2000);
                        radar.setImageResource(R.drawable.radar_new_full);
                        Thread.sleep(3000);
                        radar.setImageResource(R.drawable.radar_new_50);
                        Thread.sleep(2000);
                        radar.setImageResource(R.drawable.radar_new_found);
                    } catch (InterruptedException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                    finally{

                    }
                }

            });
            counter.start();
        }
    });
}


@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // TODO Auto-generated method stub
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.menu, menu);
    return super.onCreateOptionsMenu(menu);
}

@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    // TODO Auto-generated method stub
    switch(item.getItemId()){
    case R.id.new_search:
        startActivity(new Intent("com.zwiebel.MENU"));

    }
    return super.onMenuItemSelected(featureId, item);
}




}
</code></pre>

<p>And here is the layout: </p>

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

  &lt;Button
        android:id="@+id/magnifier"
        android:layout_width="25dp"
        android:layout_height="25dp"
        android:layout_gravity="right"
        android:background="@drawable/searchmagnificer"
  /&gt;

  &lt;ImageView
        android:id="@+id/radar"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:paddingTop="5dp"
         /&gt;

  &lt;ImageView
        android:id="@+id/text"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        /&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>I haven't seen any problem in the code, so I don't know what's the error.</p>
