Extending Android.app.application manifest problem
<p>I get a classnotfoundexception when I try to get my custom application class.
My package structure:</p>

<pre><code>be.test.helloworld.data.DataClass (extends Application -&gt;not found)
be.test.helloworld.activities.MapGetLocationActivity (Activity -&gt; works)
</code></pre>

<p>I think the problem is in my manifest:</p>

<pre><code>&lt;!-- doesn't work --&gt;
&lt;application android:name=".data.DataClass" android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"&gt; 
&lt;!-- this works --&gt;
&lt;activity android:label="@string/map" android:name=".activities.MapGetLocationActivity"&gt;&lt;/activity&gt;
</code></pre>

<p>It used to work without android:name in application tag. But now when I try to create a custom application object it doesnt't work.</p>

<p>Is it a problem with my manifest? Or can anyone tell me the problem?</p>

<p>My custom application class is almost identical to top answer here(<a href="http://stackoverflow.com/questions/708012/android-how-to-declare-global-variables">Android: How to declare global variables?</a>)</p>

<p>edit: my stacktrace</p>

<pre><code>04-15 10:25:33.434: WARN/dalvikvm(17609): threadid=1: thread exiting with uncaught exception (group=0x40028a00)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609): FATAL EXCEPTION: main
04-15 10:25:33.534: ERROR/AndroidRuntime(17609): java.lang.RuntimeException: Unable to instantiate application be.test.helloworld.data.DataClass: java.lang.ClassNotFoundException: be.test.helloworld.data.DataClass in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/be.test.helloworld-1.apk]
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:668)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4461)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at android.app.ActivityThread.access$3000(ActivityThread.java:135)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2176)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at android.os.Looper.loop(Looper.java:143)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at android.app.ActivityThread.main(ActivityThread.java:4914)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at java.lang.reflect.Method.invokeNative(Native Method)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at java.lang.reflect.Method.invoke(Method.java:521)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at dalvik.system.NativeStart.main(Native Method)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609): Caused by: java.lang.ClassNotFoundException: be.test.helloworld.data.DataClass in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/be.test.helloworld-1.apk]
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at android.app.Instrumentation.newApplication(Instrumentation.java:944)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:659)
04-15 10:25:33.534: ERROR/AndroidRuntime(17609):     ... 11 more
</code></pre>

<p>edit manifest added:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="be.test.helloworld"
    android:versionCode="1"
    android:versionName="1.0"&gt;
    &lt;uses-sdk android:minSdkVersion="4" /&gt;

    &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" /&gt;
    &lt;uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /&gt;
    &lt;uses-permission android:name="android.permission.CAMERA" /&gt;
    &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
    &lt;uses-feature android:name="android.hardware.camera" /&gt;
    &lt;uses-feature android:name="android.hardware.camera.autofocus" /&gt;

    &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;

    &lt;uses-permission android:name="android.permission.FLASHLIGHT" /&gt;
    &lt;uses-feature android:name="android.hardware.camera.flash" /&gt;
    &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
    &lt;uses-permission android:name="android.permission.SEND_SMS" /&gt;

    &lt;application android:name=".data.DataClass"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"&gt;
        &lt;uses-library android:name="com.google.android.maps" /&gt;

        &lt;activity android:label="@string/app_name"
            android:name=".activities.MainActivity"&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;activity android:label="@string/map_get_location"
            android:name=".activities.MapGetLocationActivity"&gt;
        &lt;/activity&gt;

        &lt;receiver android:process=":remote"
            android:name=".timer.AlarmReceiver"&gt;&lt;/receiver&gt;
    &lt;/application&gt;
&lt;/manifest&gt;
</code></pre>
