0

I am developing an application which i wanna use a login and a register form. For that reason i am following this tutorial.

This tutorial ask me to create a new java file with name AppController that extends Application. I did this and all the stuff, but when i run my app i get a NullPointerException, probably because i have not declared the AppController in the Manifest.

I have seen this thread where the poster had the same issue with me. Everyone told him to add the AppController to the Manifest, under the application tag. I tried also to do this but my app crashes. I have a lot of Activities tha are declared in the Manifest with the <activity> tag under the <application tag. A piece of my Manifest is below for example.

<application
    android:allowBackup="true"
    android:icon="@drawable/getaroom"
    android:label="@string/welcome"
    android:name="com.example.package.AppController"
    android:theme="@style/AppBaseTheme">"


    <activity
        android:name=".LoginActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
    </activity>
    <activity
        android:name=".CreateAccountActivity"
        android:label="@string/title_activity_activity_create_account"
        android:screenOrientation="portrait">
    </activity>
    <activity
        android:name=".MainScreenActivity"
        android:label="@string/title_activity_main_screen"
        android:screenOrientation="portrait">
    </activity>

As you can see i have declared the AppController in the application tag, but then app crashes. This is a java file that extends Application, my other java files extends ActionBarActivity.

My question is, how can i declare the new file in the Manifest? Or how can i add a new file that extends Activity to an already existed app?

Thanks in advance

Community
  • 1
  • 1
Kzaf
  • 563
  • 7
  • 19

1 Answers1

0

I have figure it out, i just have to declare the AppController in the Manifest but somehow i get an error everytime i declare it. I use android:name=".Packagename.AppController" and now it is working. thanks for the help!

Kzaf
  • 563
  • 7
  • 19