File tree 2 files changed +12
-0
lines changed
java/com/merttan/artbookapp
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
2
<manifest xmlns : android =" http://schemas.android.com/apk/res/android"
3
3
package =" com.merttan.artbookapp" >
4
+ <uses-permission android : name =" android.permission.MANAGE_EXTERNAL_STORAGE" ></uses-permission >
4
5
5
6
<application
6
7
android : allowBackup =" true"
Original file line number Diff line number Diff line change 1
1
package com.merttan.artbookapp
2
2
3
+ import android.content.pm.PackageManager
3
4
import androidx.appcompat.app.AppCompatActivity
4
5
import android.os.Bundle
5
6
import android.view.View
7
+ import androidx.core.content.ContextCompat
8
+ import java.util.jar.Manifest
6
9
7
10
class MainActivity2 : AppCompatActivity () {
8
11
override fun onCreate (savedInstanceState : Bundle ? ) {
@@ -12,6 +15,14 @@ class MainActivity2 : AppCompatActivity() {
12
15
13
16
14
17
fun selectImage (view : View ){
18
+ /*
19
+ Kullanıcıdan uygulama çalışırken galerisini kullanmak için izin isteriz
20
+ bu işlemi AndroidMnifest dosyasında yaparız. Eğer ki kullanıcıdan izin
21
+ aldıysak ve kullanıcı daha önceden bu izni onayladıysa bunu her seferinde
22
+ istemeyiz. Android 23 sürümü öncesi bu izin işlemleri gerekmiyordu*/
23
+
24
+ if (ContextCompat .checkSelfPermission(this , android.Manifest .permission.READ_EXTERNAL_STORAGE ) != PackageManager .PERMISSION_GRANTED )
25
+
15
26
16
27
}
17
28
}
You can’t perform that action at this time.
0 commit comments