Skip to content

Commit

Permalink
added launch() method to call the request permission popup
Browse files Browse the repository at this point in the history
  • Loading branch information
javafa committed Jul 24, 2022
1 parent cf0524f commit 9764e6a
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 4 deletions.
10 changes: 10 additions & 0 deletions CameraUseOriginal/.idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions CameraUseOriginal/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ContentResolver/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ContentResolver/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.example.contentresolver

import android.Manifest
import android.os.Bundle
import android.provider.MediaStore
import android.util.Log
import android.widget.Toast
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
Expand All @@ -27,9 +29,12 @@ class MainActivity : AppCompatActivity() {
finish()
}
}

storagePermission.launch(Manifest.permission.READ_EXTERNAL_STORAGE)
}

fun startProcess() {
Log.d(localClassName, "cr===> startProcess")
val adapter = MusicRecyclerAdapter()
adapter.musicList.addAll(getMusicList())
binding.recyclerView.adapter = adapter
Expand Down
2 changes: 1 addition & 1 deletion ContentResolver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
classpath 'com.android.tools.build:gradle:7.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
2 changes: 1 addition & 1 deletion ContentResolver/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip

0 comments on commit 9764e6a

Please sign in to comment.