0

I wanted to call login_activity (login credentials screen) as main_activity in Android studio.
I have written following code, but when I run the app, it is crashing.
I got to know that we should change the main_acitivity in Android.Manifests.xml file,corrected it, but app still crashing.

    <activity
        android:name=".LoginActivity"
        android:label="My SRIB"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".MainActivity"></activity>
5
  • 1
    Post crash error message. also, the manifest file is called AndroidManifest.xml Commented Nov 24, 2016 at 11:52
  • You should do a clean & rebuild Commented Nov 24, 2016 at 11:54
  • Please post your logcat :) Commented Nov 24, 2016 at 12:07
  • Logcat: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window$Callback android.view.Window.getCallback()' on a null object reference Commented Nov 24, 2016 at 12:39
  • Got the problem. I was calling findViewById before onCreate method,which I should not do Commented Nov 24, 2016 at 12:42

1 Answer 1

0

Got the problem. I was calling findViewById before onCreate method,which I should not do

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.