title: error in the statement (Build.VERSION_CODES.JELLY_BEAN)
body: <p>this is the utility java class to check which version of android is being used....but there is an error in the statement  @interface TargetApi(Build.VERSION_CODES.JELLY_BEAN)...what may be the possible reasons and how can I remove it??</p>
  
  <pre><code>package com.example.ishan.complainbox;
  
  /**
   * Created by ishan on 11/04/2017.
  */
  import android.os.Build;
  import android.content.Context;
  import android.support.v4.app.ActivityCompat;
  import android.support.v4.content.ContextCompat;
  import android.support.v7.app.AlertDialog;
  import android.Manifest;
  import android.content.pm.PackageManager;
  import android.content.DialogInterface;
   public class Utility {
   public static final int MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE = 123;
  
   @interface TargetApi(Build.VERSION_CODES.JELLY_BEAN)
   public static boolean checkPermission(final Context context)
    {
      int currentAPIVersion = Build.VERSION.SDK_INT;
      if(currentAPIVersion&gt;=android.os.Build.VERSION_CODES.M)
      {
          if (ContextCompat.checkSelfPermission(context, 
    Manifest.permission.READ_EXTERNAL_STORAGE) != 
    PackageManager.PERMISSION_GRANTED)
          {
              if 
  (ActivityCompat.shouldShowRequestPermissionRationale((MainActivity) context, 
  Manifest.permission.READ_EXTERNAL_STORAGE))
              {
                  AlertDialog.Builder alertBuilder = new 
  AlertDialog.Builder(context);
                  alertBuilder.setCancelable(true);
                  alertBuilder.setTitle("Permission necessary");
                  alertBuilder.setMessage("External storage permission is 
  necessary");
                  alertBuilder.setPositiveButton(android.R.string.yes, new 
  DialogInterface.OnClickListener() {
                      @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
                      public void onClick(DialogInterface dialog, int which) {
                          ActivityCompat.requestPermissions((MainActivity) 
  context, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 
  MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
                      }
                  });
                  AlertDialog alert = alertBuilder.create();
                  alert.show();
  
              } else
                  {
                  ActivityCompat.requestPermissions((MainActivity) context, 
  new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 
  MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
              }
              return false;
          } else {
              return true;
          }
      } else
          {
          return true;
      }
  }
  }
  </code></pre>