Here's the scenario: I have 2 modules (in Android Studio, File → New → New Module) in one application.
Module A (its not a library project. It starts gradle with the use of the plugin: "com.android.application").
Module B (which is also not a library module).
Inside module B, I need to call an action (e.g. MainActivity) that belongs to module A.
Manifest module:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.abc.emergencycontacts"> <uses-permission android:name="android.permission.READ_CONTACTS"></uses-permission> <uses-permission android:name="android.permission.WRITE_CONTACTS"></uses-permission> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true"> <activity android:name=".EmergencyContactsActivity" android:theme="@style/AppTheme"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
Module B score:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.abc.secondaryactivity"> <application android:allowBackup="true" android:label="@string/app_name" android:supportsRtl="true"> <activity android:name=".BaseAppActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
How do I achieve this?
Please note that I cannot add the dependency of module A in module B, since module A is not a library module.
Awaiting your valuable reply.
source share