error "unable to instantiate activity"
<p>I know there are many people who have the problem. I've tried many ways I can find, however still get the error.</p>

<ol>
<li>there's only one activity and it's registered.</li>
<li>tried to complete .MainActivity by com.hermione.woodenfish.MainActivity, no use</li>
<li>clean and rebuild don't work either</li>
</ol>

<p>really need help, thanks!!</p>

<p>LogCat:</p>

<pre><code>08-01 12:09:33.944: E/Trace(1032): error opening trace file: No such file or directory (2)
08-01 12:09:34.384: D/AndroidRuntime(1032): Shutting down VM
08-01 12:09:34.424: W/dalvikvm(1032): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
08-01 12:09:34.465: E/AndroidRuntime(1032): FATAL EXCEPTION: main
08-01 12:09:34.465: E/AndroidRuntime(1032): java.lang.RuntimeException: Unable to     instantiate activity   ComponentInfo{com.hermione.woodenfish/com.hermione.woodenfish.MainActivity}: java.lang.NullPointerException
08-01 12:09:34.465: E/AndroidRuntime(1032):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at android.app.ActivityThread.access$600(ActivityThread.java:130)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at android.os.Looper.loop(Looper.java:137)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at android.app.ActivityThread.main(ActivityThread.java:4745)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at java.lang.reflect.Method.invokeNative(Native Method)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at java.lang.reflect.Method.invoke(Method.java:511)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at dalvik.system.NativeStart.main(Native Method)
08-01 12:09:34.465: E/AndroidRuntime(1032): Caused by: java.lang.NullPointerException
08-01 12:09:34.465: E/AndroidRuntime(1032):     at android.content.ContextWrapper.getResources(ContextWrapper.java:81)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at android.media.MediaPlayer.create(MediaPlayer.java:824)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at com.hermione.woodenfish.MainActivity.&lt;init&gt;(MainActivity.java:24)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at java.lang.Class.newInstanceImpl(Native Method)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at java.lang.Class.newInstance(Class.java:1319)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
08-01 12:09:34.465: E/AndroidRuntime(1032):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
08-01 12:09:34.465: E/AndroidRuntime(1032):     ... 11 more
08-01 12:33:02.784: E/Trace(1171): error opening trace file: No such file or directory (2)
08-01 12:33:03.125: D/AndroidRuntime(1171): Shutting down VM
08-01 12:33:03.125: W/dalvikvm(1171): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
08-01 12:33:03.154: E/AndroidRuntime(1171): FATAL EXCEPTION: main
08-01 12:33:03.154: E/AndroidRuntime(1171): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.hermione.woodenfish/com.hermione.woodenfish.MainActivity}: java.lang.NullPointerException
08-01 12:33:03.154: E/AndroidRuntime(1171):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at android.app.ActivityThread.access$600(ActivityThread.java:130)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at android.os.Looper.loop(Looper.java:137)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at android.app.ActivityThread.main(ActivityThread.java:4745)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at java.lang.reflect.Method.invokeNative(Native Method)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at java.lang.reflect.Method.invoke(Method.java:511)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at dalvik.system.NativeStart.main(Native Method)
08-01 12:33:03.154: E/AndroidRuntime(1171): Caused by: java.lang.NullPointerException
08-01 12:33:03.154: E/AndroidRuntime(1171):     at android.content.ContextWrapper.getResources(ContextWrapper.java:81)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at android.media.MediaPlayer.create(MediaPlayer.java:824)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at com.hermione.woodenfish.MainActivity.&lt;init&gt;(MainActivity.java:23)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at java.lang.Class.newInstanceImpl(Native Method)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at java.lang.Class.newInstance(Class.java:1319)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
08-01 12:33:03.154: E/AndroidRuntime(1171):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
08-01 12:33:03.154: E/AndroidRuntime(1171):     ... 11 more
</code></pre>

<p>MainActivity.java</p>

<pre><code>package com.hermione.woodenfish;

import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    private MediaPlayer mp = MediaPlayer.create(this, R.raw.knok);
    public void sendKnok(View view) {
        if (mp.isPlaying()){
            mp.stop();
        }
        mp.start();
    }
}
</code></pre>

<p>Manifest:</p>

<pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.hermione.woodenfish"
    android:versionCode="1"
    android:versionName="1.0" &gt;

    &lt;uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" /&gt;

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

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