Skip to content

Commit a6817ac

Browse files
committed
fix: check if intent is null in MainActivity
1 parent e1471f5 commit a6817ac

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

app/src/main/java/io/github/sds100/keymapper/BaseMainActivity.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ abstract class BaseMainActivity : AppCompatActivity() {
157157
return@launchRepeatOnLifecycle
158158
}
159159

160-
when (intent.action) {
160+
when (intent?.action) {
161161
ACTION_SHOW_ACCESSIBILITY_SETTINGS_NOT_FOUND_DIALOG -> {
162162
viewModel.onCantFindAccessibilitySettings()
163163
viewModel.handledActivityLaunchIntent = true
@@ -228,10 +228,15 @@ abstract class BaseMainActivity : AppCompatActivity() {
228228
}
229229
}
230230

231-
private fun importKeyMaps(intent: Intent) {
231+
private fun importKeyMaps(intent: Intent?) {
232+
intent ?: return
233+
232234
if (intent.action == Intent.ACTION_VIEW) {
233235
intent.data?.let {
234236
homeViewModel.onChooseImportFile(it.toString())
237+
238+
// Do not want to import again on a configuration change so set it to null
239+
this.intent = null
235240
}
236241
}
237242
}

fastlane/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ Create testing release
2929

3030
Create and deploy production release
3131

32-
### alpha
32+
### internal
3333

3434
```sh
35-
[bundle exec] fastlane alpha
35+
[bundle exec] fastlane internal
3636
```
3737

38-
Deploy alpha release
38+
Create and deploy internal testing release
3939

4040
----
4141

0 commit comments

Comments
 (0)