title: How to avoid a circular reference between projects?
body: <p>I have an android application project that also has a few android library projects. Each library project has it's own activities and resources. I've implemented the <code>NavigationDrawer</code> and would like to have it on all activities, so I created a base project (android library project) that has the drawer (following the guides in this answer: <a href="https://stackoverflow.com/a/19451842/1699611">Same Navigation Drawer in different Activities</a>). Then the idea is that each sub project (android library projects) will extend from the base but at this point I am hitting the circular reference problem.</p>
  
  <p>I have a similar structure as on this image:</p>
  
  <p><a href="https://i.stack.imgur.com/vOkTt.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vOkTt.jpg" alt="flow_diagram"></a></p>
  
  <p>There's no problem to have each activity in the Sub projects to extend from the Base library, but the problem is that the Base library also needs to know the activities(hence the circular reference), so that I can handle the clicks in the <code>NavigationDrawer</code>, something similar to that:</p>
  
  <pre><code>mDrawerList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
      @Override
      public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
          switch (position) {
              case 0:
                  Intent intent = new Intent(this, SubProjectOneActivityOne.class);
                  startActivity(intent);
                  finish();
                  break;
              case 1:
                  Intent intent1 = new Intent(this, SubProjectOneActivityTwo.class);
                  startActivity(intent1);
                  break;
              case 2:
                  Intent intent2 = new Intent(this, SubProjectTwoActivityOne.class);
                  startActivity(intent2);
                  break;
              default:
                  break;
      }
  }});
  </code></pre>
  
  <p>So at the moment I am hitting a dead end with this approach. Could it be possible to overload the click event in the sub projects? Does anybody have other suggestions?</p>