A
A
antihrust2020-05-12 23:12:40
android studio
antihrust, 2020-05-12 23:12:40

How to change default activity?

How to change the original activity. By default, it's MainActivity. I want to change to LoginPage
Below is the code in the manifest

<activity android:name=".LoginPage"></activity>
<activity android:name=".MainActivity">
     <intent-filter>
          <action android:name="android.intent.action.MAIN" />

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

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Zakharov, 2020-05-13
@antihrust

Moving the intent-filter block to the LoginPage

C
Chesterfield25, 2020-05-15
@Chesterfield25

<activity android:name=".LoginPage">
    <intent-filter>
          <action android:name="android.intent.action.MAIN" />

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

And we remove this line from MainActivity
<action android:name="android.intent.action.MAIN" />

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question