title: ActivityCompat.requestPermissions(this, new String[] {Manifest.permission.ACCESS_FINE_LOCATION},REQ_LOC);:ERROR:-Cannot resolve REQ_LOC
body: <p>Cannot resolve REQ_LOC for requesting location permission. I have asked for required permissions in the manifest file.
  java code is:</p>
  
  <p>enter code here</p>
  
  <pre><code>    locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
      locationManager.getAllProviders();
  
      if (ActivityCompat.checkSelfPermission(this,
              Manifest.permission.ACCESS_FINE_LOCATION)
              != PackageManager.PERMISSION_GRANTED)
          ActivityCompat.requestPermissions(this, new String[]
                          {Manifest.permission.ACCESS_FINE_LOCATION},Request_Location_Permission);
  
      Toast.makeText(this, "Got out of checing condition", Toast.LENGTH_SHORT).show();
      if(locationManager.isProviderEnabled(locationManager.NETWORK_PROVIDER)) {
          Toast.makeText(this, "Provider enabled" , Toast.LENGTH_SHORT).show();
          locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, new LocationListener() {
              @Override
              public void onLocationChanged(Location location) {
                  double latitude = location.getLatitude();
                  double longitude = location.getLongitude();
                  Toast.makeText(driver.this, "onlocationchange:"+latitude, Toast.LENGTH_SHORT).show();
              }
  
              @Override
              public void onStatusChanged(String provider, int status, Bundle extras) {
  
              }
  
              @Override
              public void onProviderEnabled(String provider) {
  
              }
  
              @Override
              public void onProviderDisabled(String provider) {
  
              }
          });
      }
      else if(locationManager.isProviderEnabled(locationManager.GPS_PROVIDER)) {
          locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, new LocationListener() {
              @Override
              public void onLocationChanged(Location location) {
                  double latitude = location.getLatitude();
                  double longitude = location.getLongitude();
                  Toast.makeText(driver.this, "onlocationchange:"+latitude, Toast.LENGTH_SHORT).show();
              }
  
              @Override
              public void onStatusChanged(String provider, int status, Bundle extras) {
  
              }
  
              @Override
              public void onProviderEnabled(String provider) {
  
              }
  
              @Override
              public void onProviderDisabled(String provider) {
  
              }
          });
      }
      else {
          Toast.makeText(this, "No prover enabled", Toast.LENGTH_SHORT).show();
      }
  
  
      }
  </code></pre>
  
  <p>My manifest file is:</p>
  
  <pre><code>enter code here&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"&gt;
      &lt;activity android:name=".MainActivity"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity android:name=".parent" /&gt;
      &lt;activity android:name=".driver" /&gt;
      &lt;!--
           The API key for Google Maps-based APIs is defined as a string resource.
           (See the file "res/values/google_maps_api.xml").
           Note that the API key is linked to the encryption key used to sign the APK.
           You need a different API key for each encryption key, including the release key that is used to
           sign the APK for publishing.
           You can define the keys for the debug and release targets in src/debug/ and src/release/. 
      --&gt;
      &lt;meta-data
          android:name="com.google.android.geo.API_KEY"
          android:value="@string/google_maps_key" /&gt;
  
      &lt;activity
          android:name=".Map"
          android:label="@string/title_activity_map" /&gt;
      &lt;activity
          android:name=".maps"
          android:label="@string/title_activity_maps"&gt;&lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>
  The Error as shown in Android studio:
  <a href="https://i.stack.imgur.com/gBcGK.jpg" rel="nofollow noreferrer">Code Snippet</a></p>
  
  <p>When I Hover the mouse pointer over the error it says 
   "Cannot Resolve Request_Location_Permission".</p>
  
  <p>I went through several tutorials and documentation.Never encountered anyone having the same issue.</p>