问题
I have two modules in my android studio project. One module displays "Hello World" on screen, and the other module displays "Hello Module" on screen. How to decide, which module to run when the app launches. Apparently "Hello Module" is getting displayed on screen. How to use the other module by default on launch of the app.
回答1:
Before the apk is generated, all the manifests in your project are combined in a process called as manifest-merging. So you should be able to change launcher activity by moving the following intent-filter from your old launcher activity to the new launcher activity:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
回答2:
Since Veneet Reddy has given the correct idea about your problem, I'm about to give you this solution in the manifest file do it like this :
<activity android:name=".YourDesiredActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
This is the way to do this. However the Manifest file will be seen in the android studio in your left window pane and do remember to choose the Android option from above the menu See the image you'll get a better idea.
Happy Learning!
来源:https://stackoverflow.com/questions/46331849/how-change-default-on-launch-module-in-android-studio