From cba527375e6bebef14f7201866c00dcb9b308e94 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Sat, 9 Jul 2016 17:46:18 +0300 Subject: [PATCH] Cleaning --- .../matan/ara/sagi/thesocialnotework/SettingsFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/SettingsFragment.java b/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/SettingsFragment.java index ebbbcf7..96e09cb 100644 --- a/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/SettingsFragment.java +++ b/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/SettingsFragment.java @@ -114,8 +114,8 @@ public class SettingsFragment extends Fragment implements View.OnClickListener, case R.id.btn_camera: //check for permission // ActivityCompat.requestPermissions(parent, new String[]{Manifest.permission.CAMERA}, 1); - if ((ActivityCompat.checkSelfPermission((MainActivity) getActivity(), android.Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) - &&(ActivityCompat.checkSelfPermission((MainActivity) getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED)) { + if ((ActivityCompat.checkSelfPermission(parent, android.Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) + &&(ActivityCompat.checkSelfPermission(parent, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED)) { openCamera(view); }else{ Toast.makeText(getActivity(), "No Camera or Storage Permissions granted.\n\"An App is nothing without its permissions\"", Toast.LENGTH_LONG).show();