title: Launching activity from library : NullPointerException
body: <p>I'm coming from : <a href="https://stackoverflow.com/questions/17063826/how-to-create-jar-for-android-library-project/17064024#17064024">How to create jar for Android Library Project</a></p>
  
  <p>which is an accepted answer so i assume it would work as intented. BUT :</p>
  
  <p>I have a project A with a library B attached to it (Properties->Android->Library->Add)</p>
  
  <p>The library B is declared as a library (Properties->Android->Library->Is library checked) and i have followed the step described by Commonsware in the original thread linked above (meaning, my classes are in a jar in my library and src folder is empty to ensure my library will not be modified like an open source one)</p>
  
  <p>I have declared activities from my library B in the manifest of A. And there is no activity nor ressources with the same name in B and A.</p>
  
  <p>I am using it in A like this :</p>
  
  <pre><code>Intent i = new Intent(MainActivity.this.getApplicationContext(), com.dmdsante.mydmdpost.activity.MdpMainActivity.class);
  i.putExtra("access_token", "test");
  startActivity(i);
  </code></pre>
  
  <p>And i get the following error :</p>
  
  <pre><code>06-24 14:25:49.826: E/AndroidRuntime(14778): FATAL EXCEPTION: main
  06-24 14:25:49.826: E/AndroidRuntime(14778): Process: com.example.ids, PID: 14778
  06-24 14:25:49.826: E/AndroidRuntime(14778): java.lang.NullPointerException
  06-24 14:25:49.826: E/AndroidRuntime(14778): at com.dmdsante.mydmdpost.activity.MdpMainActivity$GetConfig.onPostExecute(MdpMainActivity.java:303)
  06-24 14:25:49.826: E/AndroidRuntime(14778): at com.dmdsante.mydmdpost.activity.MdpMainActivity$GetConfig.onPostExecute(MdpMainActivity.java:1)
  06-24 14:25:49.826: E/AndroidRuntime(14778): at android.os.AsyncTask.finish(AsyncTask.java:632)
  06-24 14:25:49.826: E/AndroidRuntime(14778): at android.os.AsyncTask.access$600(AsyncTask.java:177)
  06-24 14:25:49.826: E/AndroidRuntime(14778): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
  06-24 14:25:49.826: E/AndroidRuntime(14778): at android.os.Handler.dispatchMessage(Handler.java:102)
  06-24 14:25:49.826: E/AndroidRuntime(14778): at android.os.Looper.loop(Looper.java:136)
  06-24 14:25:49.826: E/AndroidRuntime(14778): at android.app.ActivityThread.main(ActivityThread.java:5017)
  06-24 14:25:49.826: E/AndroidRuntime(14778): at java.lang.reflect.Method.invokeNative(Native Method)
  06-24 14:25:49.826: E/AndroidRuntime(14778): at java.lang.reflect.Method.invoke(Method.java:515)
  06-24 14:25:49.826: E/AndroidRuntime(14778): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
  06-24 14:25:49.826: E/AndroidRuntime(14778): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
  06-24 14:25:49.826: E/AndroidRuntime(14778): at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>line 303 refers to <code>btn_devenez_evaluateur.setText("test");</code> in this sample of code from the library B :</p>
  
  <pre><code>setContentView(com.dmdsante.mydmdpost.R.layout.mdp_activity_main);
  btn_devenez_evaluateur = (Button) findViewById(com.dmdsante.mydmdpost.R.id.btn_devenez_evaluateur);
  btn_devenez_evaluateur.setText("test");
  </code></pre>
  
  <p>When i am using B as a library but in a classic way (meaning no jar and classes in src folder), all works fine. What am i doing wrong ? </p>
  
  <p>EDIT : 
  manifest.xml from project A :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.ids"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="10"
          android:targetSdkVersion="19" /&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.GET_TASKS" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  
      &lt;application
          android:icon="@drawable/ic_launcher"
          android:allowBackup="true"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name="com.example.ids.MainActivity"
              android:launchMode="singleTask" &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.dmdsante.mydmdpost.activity.MdpMainActivity"
              android:windowSoftInputMode="stateHidden" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.dmdsante.mydmdpost.activity.MdpSearchActivity"
              android:windowSoftInputMode="stateHidden" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.dmdsante.mydmdpost.listview.MdpPlatformListViewActivity"
              android:windowSoftInputMode="stateHidden" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.dmdsante.mydmdpost.activity.MdpLookupActivity" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.dmdsante.mydmdpost.activity.MdpFullScreenViewActivity" &gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>