Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
- super.onRequestPermissionsResult(requestCode, permissions, grantResults);
- switch (requestCode)
- {
- case PERMISSIONS_REQUEST_READ_CONTACTS: {
- if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED)
- {
- Toast.makeText(Splash.this, "Permission Telah di izinkan.", Toast.LENGTH_SHORT).show();
- //reload my activity with permission granted or use the features what required the permission
- finish();
- startActivity(getIntent());
- } else
- {
- Toast.makeText(Splash.this, "The app was not allowed to get your phone state. Hence, it cannot function properly. Please consider granting it this permission", Toast.LENGTH_LONG).show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement