Q:

How to fix this classnotfound exception in Android?

I got the stack trace below in the Android developer account. There is just one occurrence of this error.
java.lang.RuntimeException: Unable to instantiate application com.mysite.myapp.TestApplication: java.lang.ClassNotFoundException: com.mysite.myapp.TestApplication in loader dalvik.system.PathClassLoader[/data/app-private/com.mysite.myapp-2.apk]
at android.app.LoadedApk.makeApplication(LoadedApk.java:466)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3268)
at android.app.ActivityThread.access$2200(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:973)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3691)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.myapp.myapp.TestApplication in loader dalvik.system.PathClassLoader[/data/app-private/com.mysite.myapp-2.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at android.app.Instrumentation.newApplication(Instrumentation.java:945)
at android.app.LoadedApk.makeApplication(LoadedApk.java:461)
... 11 more

In my manifest file, I have declared com.mysite.myapp.TestApplication.
My Manifest file looks like this:
<application
    android:name="com.mysite.myapp.TestApplication"
    android:icon="@drawable/app_icon"
    android:label="@string/app_name"
    android:theme="@style/Theme.myapp" >
    <activity
        android:name="com.mysite.myapp.ActivityDashboard"
        android:configChanges="orientation|keyboard"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
...

A:

If your main home page is ActivityDashboard.java
insert as below or if TestApplication.java
replace .ActivityDashboard as .TestApplication in the activity tag
<package name="com.mysite.myapp"
    <application
        android:name="TestApplication"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:theme="@style/Theme.myapp" >

        <activity android:name=".ActivityDashboard" android:configChanges="orientation|keyboard"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
    ......
    </application>

