I’m having troubles extending the Application class to declare global variables. I have extended the Application class as folows:
public class RunKeeper extends Application{
private String filename = getResources().getString(R.string.filename);
private Runner runner;
public RunKeeper(){ }
}
The class above is in the com.tmeersschaert.android.runkeeper.domain package. I have edited the application manifest as (I think) it should be:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tmeersschaert.android.runkeeper"
android:versionCode="1"
android:versionName="1.0">
<application android:name=".domain.RunKeeper" android:icon="@drawable/icon" android:label="@string/app_name"></application>
</manifest>
The problem is that I keep getting a “Source not found”, NullPointer exception during the LoadedApk.makeApplication() method.
Any thoughts on how to solve this?
I think you should put the line
in your constructor.
Have you also tried to use the whole package name: