I'm studying Android programming and I'm having an error. It says:
"com.google.android.gms.auth.UserRecoverableAuthException: NeedPermission"
Code
Permissions
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
Error
Caused by: com.google.android.gms.auth.UserRecoverableAuthException: NeedPermission
I googled for whole day but not solved yet.
I'm using Youtube API and I have error for it.
Please help me.
Yes, added to Google API page.
https://i.sstatic.net/16PnR.png
And also YouTube API has ENABLED.
++ADDED
Class
private Context context1;
public YouTubePlaylistsLoader(Context context) {
super(context);
this.context1 = context;
}
and I tried
context1.startActivityForResult(e.getIntent(), REQUEST_AUTHORIZATION);
But It says cannot resolve that function. I pressed Ctrl + SPACE and It only shows "startActivity(intent)"