0

I created an Android Studio project, next clicked on File/New/Import module and selected the project directory of an opensource project.

Next, in the build.gradle (app), I added:

  dependencies {
      compile project(':moduleName')
  }

It seems to works, because I have two configurations: one for my project and one for the module. I can run my project or the module, but I would like to start a module activity from my main project when I press on a button. How can I do?

In particular I want to create an application that incorporates this opensource project: https://github.com/schwabe/ics-openvpn

And I would like to start the main activity of that project from one button in the Activity of my application. I want to do this so to not install two applications (the opensource project one and mine), but only one (mine).

Wish you can understand me.

helloimyourmind
  • 994
  • 4
  • 14
  • 30

2 Answers2

0

In androidManifest file put intent filter tag to the activity to which you want to start when app is launched.

0
<?xml version="1.0" encoding="utf-8"?>

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".Home">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

    </activity>
</application>

This is an Android manifest file of my project , <activity android:name=".Home"> ,this is the main activity which opens at the start of the app and the second one is <activity android:name=".Subactivity"> </activity> . If you want the second activity as your main activity , just cut same Intent filter which is present in the <activity android:name=".Home"> copy to the <activity android:name=".Subactivity">

Ko Vartthan
  • 434
  • 1
  • 4
  • 22