first check if element exist, then access it
This commit is contained in:
parent
39be1bb4c7
commit
b2d2f462f6
1 changed files with 3 additions and 3 deletions
|
@ -244,8 +244,8 @@ public class MainActivity extends AppCompatActivity {
|
|||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
if(ActivityCompat.checkSelfPermission(this, permissions[0]) == PackageManager.PERMISSION_GRANTED){
|
||||
if (permissions.length != 0) {
|
||||
if (ActivityCompat.checkSelfPermission(this, permissions[0]) == PackageManager.PERMISSION_GRANTED) {
|
||||
switch (requestCode) {
|
||||
case CASE_STORAGE:
|
||||
//show dialog after permission is granted
|
||||
|
|
Loading…
Reference in a new issue