android / android/architecture-samples

HiltTestActivity missing setTheme()

Open
#832 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Kotlin
Stars
45.8k
Forks
11.9k
PR merge metrics
No merged PRs in 30d

Description

I was looking at `HiltTestActivity` comparing to `EmptyTestActivity` it is missing `setTheme()` during `onCreate()` method.

```kotlin
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setTheme(
intent.getIntExtra(
"androidx.fragment.app.testing.FragmentScenario.EmptyFragmentActivity.THEME_EXTRAS_BUNDLE_KEY",
R.style.FragmentScenarioEmptyFragmentActivityTheme
)
)
}

```

This ignores the theme passed to `launchFragmentInHiltContainer` method

Contributor guide

Open the contributing guide

Research direction

Search for HiltTestActivity and launchFragmentInHiltContainer, then inspect HiltTestActivity.onCreate and compare it with EmptyTestActivity. Confirm how the theme extra is passed, and verify that the activity applies the supplied theme when launching a fragment in the Hilt test container.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev, testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.