title: Referencing resources in module
body: <p>I've create a module at Android Studio. In module code, I want to show a dialog which uses a layout defined in the module. When I reference layout like     <strong>net.gwtr.module.R.layout.my_dialog_layout</strong>, I get this exception;</p>
  
  <pre><code>java.lang.ClassNotFoundException: Didn't find class "net.gwtr.module.R$layout" on path: DexPathList[[zip file "/data/app/net.gwtr.moduletest-1.apk"],nativeLibraryDirectories=[/data/app-lib/net.gwtr.moduletest-1, /vendor/lib, /system/lib]]
  </code></pre>
  
  <p>I think the reason is that resources are merged when you add a module to project. It did not create different resource ids for the module package name. So i cannot reach to resources from module package.</p>
  
  <p>How can I reference resources of module in module code?</p>
  
  <p>Edit1:
  I reference resource like this;</p>
  
  <pre><code>Dialog dialog = new Dialog(context);
  dialog.setContentView(R.layout.my_dialog_layout);
  dialog.show();
  </code></pre>
  
  <p>Edit2:
  <strong>I found a way but i don't want to use this every time when I reference resource.</strong></p>
  
  <p>I can reach resources when I get resource id with this;</p>
  
  <pre><code>context.getResources().getIdentifier("my_dialog_layout", "layout", context.getPackageName())
  </code></pre>