Skip to content

Commit

Permalink
moved to onresume
Browse files Browse the repository at this point in the history
  • Loading branch information
bskjon committed Nov 19, 2024
1 parent ccdcf54 commit ec4610c
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ abstract class SettingsActivity: AppCompatActivity() {
)
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

private fun generate() {
val components: Any? = if (intent.hasExtra(componentPassKey)) intent.getSerializableExtra(componentPassKey) else if (preCreatedSettingItems().isNotEmpty()) preCreatedSettingItems() else throw NoUiComponentsPassed("No Ui Settings Components were passed upon initialization")
if (components !is List<*> || !components.all { it is SettingComponentDescriptorBase }) { throw IncompatibleComponentPassed("Incompatible Ui Component were passed to SettingsActivity") }

Expand All @@ -61,12 +59,17 @@ abstract class SettingsActivity: AppCompatActivity() {
addAll(manufactured)
}
}
}
}
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}

@SuppressLint("UnspecifiedRegisterReceiverFlag")
override fun onResume() {
super.onResume()
generate()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
registerReceiver(receiver, IntentFilter()
.apply {
Expand Down

0 comments on commit ec4610c

Please sign in to comment.