title: How to resolve "Resource IDs will be non-final in Android Gradle Plugin version 5.0, avoid using them in switch case statements" warning?
body: <pre><code> @Override
  public void onClick(View v) {
      switch (v.getId())
      {
          case R.id.legalInformationLL:
              startActivity(new Intent(AboutActivity.this, LegalInformation.class));
              break;
          case R.id.backIB:
              finish();
              break;
      }
  }
  </code></pre>
  <p>for this code &quot;Resource IDs will be non-final in Android Gradle Plugin version 5.0, avoid using them in switch case statements&quot; warning shows up. What is the possible solution? If I change this code to:</p>
  <pre><code> @Override
  public void onClick(View v) {
      int id = v.getId();
      if (id == R.id.legalInformationLL) {
          startActivity(new Intent(AboutActivity.this, LegalInformation.class));
      } else if (id == R.id.backIB) {
          finish();
      }
  }
  </code></pre>
  <p>warning goes; but switch statement is better for performance as compared to if statement. So what is the possible solution that will work efficiently faster?</p>