Android Activitycompat

Asked

Viewed 192 times

0

Hello by I searched from android 7.1, it is necessary to request permission running for user and it is necessary to use the class ActivityCompat for this purpose, my application saves a PDF on disk and opens it, however I cannot use this class ActivityCompat build error occurs. I’m importing from v4 and using eclipse yet, is that right? I’ve tried importing 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);
  • In fact the Runtime Permissions start from Android 6.0

2 answers

1

Activitycompat(). requestPermissions(...);

Use static class method 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);

0


Converts the app to android studio and worked the eclipse can no longer work is many bugs.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.