diff --git a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileActivity.kt b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileActivity.kt index 27cf1165..b9cf039a 100644 --- a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileActivity.kt +++ b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileActivity.kt @@ -43,7 +43,7 @@ class CustomerProfileActivity: MifosBaseActivity(),CustomerProfileContract.View override fun onOptionsItemSelected(item: MenuItem): Boolean { if (item.itemId == R.id.menu_customer_profile_share) { - checkCameraPermission() + checkWriteExternalStoragePermission() return true } else return super.onOptionsItemSelected(item) @@ -79,7 +79,7 @@ class CustomerProfileActivity: MifosBaseActivity(),CustomerProfileContract.View return returnedBitmap } - override fun checkCameraPermission() { + override fun checkWriteExternalStoragePermission() { if (CheckSelfPermissionAndRequest.checkSelfPermission(this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE)){ shareImage() @@ -110,7 +110,7 @@ class CustomerProfileActivity: MifosBaseActivity(),CustomerProfileContract.View override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray) { when (requestCode) { - ConstantKeys.PERMISSIONS_REQUEST_CAMERA -> { + ConstantKeys.PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE -> { if (grantResults.size > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { shareImage() } else { diff --git a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileContract.kt b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileContract.kt index e316a643..9765ea71 100644 --- a/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileContract.kt +++ b/app/src/main/kotlin/org/mifos/mobile/cn/ui/mifos/customerProfile/CustomerProfileContract.kt @@ -5,7 +5,7 @@ import org.mifos.mobile.cn.ui.base.MvpView interface CustomerProfileContract { interface View: MvpView{ - fun checkCameraPermission(); + fun checkWriteExternalStoragePermission(); fun requestPermission();