title: How to declare activity of a custom library in the manifest
body: <p>I try to call an activity from a library via intent. However I was unable to correct the error of the manifest declaration. I'm using Eclipse and I look for sources Android but the doc has changed, all the examples back on this damned page: <a href="http://developer.android.com/tools/help/adt.html" rel="nofollow">http://developer.android.com/tools/help/adt.html</a> 
  Can you please, explain me how proceed?</p>
  
  <p>I simplified my code to two activity:
  One in the project (MainActivity.java) and the other in a library (MyLibrary.java).</p>
  
  <pre><code>public class MainActivity extends Activity implements View.OnClickListener {
  
  Button b = null;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      b = (Button)findViewById(R.id.btn_start_second);
      b.setOnClickListener(this);
  }
  
  @Override
  public void onClick(View v) {
      switch(v.getId()){
      case R.id.btn_start_second:
          Intent intent = new Intent(getApplicationContext(), MyLibrary.class);
          startActivity(intent);
          break;
      }
  
  }
  </code></pre>
  
  <p>MyLibrary do nothing except setContentView() with a custom screen.
  I set MyLibrary as a library and correctly add it as dependency (I can see it from my project).</p>
  
  <p>android.content,ActivityNotFoundException : Unable to find explicit activity class {com.exemple.testlibrary/com.exemple.library.MyLibrary}; have you declared this activity in your AndroidManifest.xml</p>
  
  <p>And the anwers is yes :</p>
  
  <p></p>
  
  <pre><code>&lt;uses-sdk
      android:minSdkVersion="15"
      android:targetSdkVersion="22" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
  
  
      &lt;activity
          android:name=".MainActivity"
          android:label="@string/app_name" &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="com.exemple.mylibrary.MyLibrary"
          android:label="library" /&gt;
  
  
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>So I looked for examples of library declaration in the manifest, but I've only reproduce the same mistakes or bring up new ones.</p>
  
  <p>Sorry for my poor english and thanks for your time. :)</p>
  
  <p>Log error :</p>
  
  <pre><code>E/AndroidRuntime(11021): FATAL EXCEPTION: main
  E/AndroidRuntime(11021): Process: com.example.testlibrary, PID: 11021
  E/AndroidRuntime(11021): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.testlibrary/com.example.mylibrary.MyLibrary}; have you declared this activity in your AndroidManifest.xml?
  E/AndroidRuntime(11021):    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1634)
  E/AndroidRuntime(11021):    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1430)
  E/AndroidRuntime(11021):    at android.app.Activity.startActivityForResult(Activity.java:3457)
  E/AndroidRuntime(11021):    at android.app.Activity.startActivityForResult(Activity.java:3418)
  E/AndroidRuntime(11021):    at android.app.Activity.startActivity(Activity.java:3660)
  E/AndroidRuntime(11021):    at android.app.Activity.startActivity(Activity.java:3628)
  E/AndroidRuntime(11021):    at com.example.testlibrary.SecondActivity.onClick(SecondActivity.java:33)
  E/AndroidRuntime(11021):    at android.view.View.performClick(View.java:4463)
  E/AndroidRuntime(11021):    at android.view.View$PerformClick.run(View.java:18770)
  E/AndroidRuntime(11021):    at android.os.Handler.handleCallback(Handler.java:808)
  E/AndroidRuntime(11021):    at android.os.Handler.dispatchMessage(Handler.java:103)
  E/AndroidRuntime(11021):    at android.os.Looper.loop(Looper.java:193)
  E/AndroidRuntime(11021):    at android.app.ActivityThread.main(ActivityThread.java:5292)
  E/AndroidRuntime(11021):    at java.lang.reflect.Method.invokeNative(Native Method)
  E/AndroidRuntime(11021):    at java.lang.reflect.Method.invoke(Method.java:515)
  E/AndroidRuntime(11021):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
  E/AndroidRuntime(11021):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
  E/AndroidRuntime(11021):    at dalvik.system.NativeStart.main(Native Method)
  </code></pre>