Commit efb4203a authored by Ricki Hirner's avatar Ricki Hirner

EditCalendarActivity: check for WRITE_CALENDAR permission, too

parent fa67620c
......@@ -20,7 +20,6 @@ import android.net.Uri
import android.os.Bundle
import android.provider.CalendarContract
import android.support.v4.app.*
import android.support.v4.content.ContextCompat
import android.support.v4.content.Loader
import android.support.v7.app.AlertDialog
import android.support.v7.app.AppCompatActivity
......@@ -62,7 +61,8 @@ class EditCalendarActivity: AppCompatActivity(), LoaderManager.LoaderCallbacks<L
dirty = true
}
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_CALENDAR) == PackageManager.PERMISSION_GRANTED)
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_CALENDAR) == PackageManager.PERMISSION_GRANTED &&
ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_CALENDAR) == PackageManager.PERMISSION_GRANTED)
// load calendar from provider
supportLoaderManager.initLoader(0, null, this)
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment