title: Android using Gradle Build flavors in the code like an if case
body: <p>I'm trying to work with build flavors. In my build.gradle I've defined 2 flavors, a normal flavor and an admin flavor.</p>
  <p>Basicly, the admin flavor has an extra button on the main activity.</p>
  <p>I understand that I can define different packages/classes for different flavors. But is there a way to make a sort of if case to add/remove a piece of code depending on the flavor?</p>
  <p>Basicly, I would need two versions of an Activity. But I don't want two entire different versions of the activity and maintain them.</p>
  <p>So in my activity I would like to do</p>
  <p>=&gt; gradle check if flavor is 'admin'</p>
  <p>=&gt; if yes, add this code of the button</p>
  <p>Is this possible? Or would you need two different physical activities and thus maintain both of them when you add functionality afterwards.</p>