Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mutkuensert committed Aug 22, 2023
1 parent 621304d commit 87f93db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ implementation files('libs/Downloader.aar')
```

## How to Use
If you use Hilt in your project, you can initialize Downloader class like below. You should also implement a CoroutineScope and inject it.
If you use Hilt in your project, you can initialize Downloader class like below. You should also implement a CoroutineScope and inject it. You mustn't provide it as a singleton.

```kotlin
@Module
Expand Down Expand Up @@ -82,9 +82,9 @@ Initialize activity result launcher in a Fragment or an Activity:
viewModel.downloader.initActivityResultLauncher {
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
if (result.resultCode == Activity.RESULT_OK) {
uri = result.data?.data
val uri = result.data?.data

if (uri != null) this.writeToFile(uri!!)
if (uri != null) this.writeToFile(uri)
}
}
}
Expand Down

0 comments on commit 87f93db

Please sign in to comment.