title: Override Activity from Android Library project
body: <p>I have an Android project.  Now I need to create a second edition of that project.</p>
  
  <p><strong>What will differ:</strong></p>
  
  <p>New edition of the Project should have different content in one of the Activities.</p>
  
  <p>I was thinking about creating a library project and two new projects(<code>project1</code> and <code>project2</code>) which will use library project, but I don't really understand how to setup this. </p>
  
  <p>Should I just convert the original project into library, then create two new projects and <em>then what</em>? How to make <code>project1</code> use <code>activity1</code> and <code>project2</code> use <code>activity2</code> in  the same place?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>What I've set up so far:</p>
  
  <p><strong>MainProject, a library</strong> has MainActivity.java and ChildActivity.java</p>
  
  <hr>
  
  <p>AndroidManifest.xml</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.mainproject"&gt;
      &lt;application&gt;
          &lt;activity
              android:name=".MainActivity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".ChildActivity"&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p>MainActivity.java</p>
  
  <pre><code>   public class MainActivity extends Activity {
  
          @Override
          public void onCreate(Bundle savedInstanceState) {
  
              ((Button)findViewById(R.id.button1)).setOnClickListener(new OnClickListener() {
  
                  @Override
                  public void onClick(View v) {
                      Intent intent = new Intent(MainActivity.this, ChildActivity.class);
                      startActivity(intent);
                  }
              });
          }
  }
  </code></pre>
  
  <p><strong>StandAloneProject:</strong> it has only ChildActivity.java</p>
  
  <hr>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.standaloneproject"&gt;
      &lt;application&gt;
          &lt;activity
               android:name="com.example.mainproject.MainActivity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".ChildActivity" &gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p><strong>What I expect:</strong></p>
  
  <p>When I launch StandAloneProject and click button, I want ChildActivity from StandAloneProject(not from MainProject) to be launched.</p>
  
  <p><strong>What I get:</strong></p>
  
  <p>When I launch StandAloneProject, I see MainActivity from MainProject, click button and get:</p>
  
  <pre><code>android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.standaloneproject/com.example.mainproject.ChildActivity}; have you declared this activity in your AndroidManifest.xml?
  </code></pre>