title: How to get AssetManager from a library project
body: <p>I am trying to get <code>AssetManager</code> form a class in an Android library project, but I am getting the error:  </p>
  
  <pre><code>Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
  </code></pre>
  
  <p>This is how I call it:  </p>
  
  <pre><code>public class RevPluginLoader extends AppCompatActivity {
  
      private List&lt;String&gt; copyPlugins() {
          AssetManager assetManager = getAssets();  // This is where it all fails
      }
  }
  </code></pre>
  
  <p>How can I get the <code>AssetManager</code>?</p>