The Below is code for asking user permissions.If the user gives permissions then i have to take him to the next screen.After user allows permissions..then i have to take him to next screen
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (android.os.Build.VERSION.SDK_INT >= 23) {
if(!hasPermissions(this, PERMISSIONS)){
ActivityCompat.requestPermissions(this, PERMISSIONS, PERMISSION_ALL);
}
}else{
Intent intent = new Intent(MainActivity.this,LoginActivity.class);
startActivity(intent);
}
}
If I use the code below.
onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)
it is showing this error
"the method is not overriding anything with current build target,but will in api 23 current level 17"