Android ActivityCompat

0

Hello from what I researched from android 7.1, it is necessary to request permission to run for user and it is necessary to use the ActivityCompat class to do this, my application saves a PDF to disk and opens it, however I can not use this class ActivityCompat compilation error occurs. I'm importing from v4 and using eclipse still, is that right? I already tried to import from import android.support.v7.*; however this class does not appear in this package.

import android.support.v4.app.ActivityCompat;
     ActivityCompat().requestPermissions(this, new {Manifest.permission.ACCESS_FINE_LOCATION}, 0);
    
asked by anonymous 04.09.2018 / 18:07

2 answers

0

It converts the app to android studio and it worked eclipse is not enough to work is many bugs.

    
15.09.2018 / 21:03
1
  

ActivityCompat (). requestPermissions (...);

Use the static method of class ActivityCompat , you have placed parentheses, so the compiler is expecting a local method that does not exist.

ActivityCompat.requestPermissions(this, new {Manifest.permission.ACCESS_FINE_LOCATION}, 0);
    
14.09.2018 / 16:10